2 changed files with 175 additions and 10 deletions
-
56.drone.yml
-
129README.md
@ -0,0 +1,56 @@ |
|||||
|
kind: pipeline |
||||
|
name: build |
||||
|
|
||||
|
clone: |
||||
|
depth: 1 |
||||
|
|
||||
|
steps: |
||||
|
- name: build |
||||
|
image: docker.0k.io/0k-mirror-freezer |
||||
|
volumes: |
||||
|
- {name: docker, path: /var/run/docker.sock} |
||||
|
settings: |
||||
|
## This key/known host are for git mirrors repos, and parent |
||||
|
## odoo_base repository. |
||||
|
ssh_private_key: {from_secret: SSH_PRIVATE_KEY} |
||||
|
ssh_known_hosts: {from_secret: SSH_KNOWN_HOSTS} |
||||
|
## This docker json should contain both mirror access and official |
||||
|
## final build docker repository access. |
||||
|
docker_config_json: {from_secret: DOCKER_CONFIG_JSON} |
||||
|
commands: |
||||
|
- | |
||||
|
mkdir -p /root/.ssh |
||||
|
cat <<EOF > /root/.ssh/config |
||||
|
Host git.0k.io |
||||
|
User mirror |
||||
|
Port 10022 |
||||
|
EOF |
||||
|
## Warning: without 'ssh://', the port doesn't see to be used and it tries to |
||||
|
## connect to git.0k.io:22 (ssh fingerprint allows to infer this). |
||||
|
- DEBUG=1 freeze docker.0k.io git.0k.io:/var/git/mirror |
||||
|
- docker push "$(cat image)" ## this will push the new onbuild image |
||||
|
- (cd odoo && docker build . -t docker.0k.io/mirror/$(cat ../release)) |
||||
|
- docker push "docker.0k.io/mirror/$(cat release)" |
||||
|
- | |
||||
|
release=$(cat release) |
||||
|
git checkout -b "tmp" |
||||
|
git commit -am "chg: pkg: release freezing in $release" |
||||
|
git tag "$release" |
||||
|
git push "${DRONE_GIT_SSH_URL}" "$release" |
||||
|
|
||||
|
volumes: |
||||
|
- name: docker |
||||
|
host: |
||||
|
path: /var/run/docker.sock |
||||
|
|
||||
|
## Need to configure secret 'dockerconfigjson' in drone secrets to |
||||
|
## hold a valid config.json file content. These secrets here allow |
||||
|
## to access 'docker.0k.io/*' images. |
||||
|
image_pull_secrets: |
||||
|
- dockerconfigjson |
||||
|
|
||||
|
trigger: |
||||
|
branch: |
||||
|
- test/* |
||||
|
- rc/* |
||||
|
- build/* |
Write
Preview
Loading…
Cancel
Save
Reference in new issue