You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.7 KiB

  1. kind: pipeline
  2. name: build
  3. clone:
  4. depth: 1
  5. steps:
  6. - name: build
  7. image: docker.0k.io/0k-mirror-freezer
  8. volumes:
  9. - {name: docker, path: /var/run/docker.sock}
  10. settings:
  11. ## This key/known host are for git mirrors repos, and parent
  12. ## odoo_base repository.
  13. ssh_private_key: {from_secret: SSH_PRIVATE_KEY}
  14. ssh_known_hosts: {from_secret: SSH_KNOWN_HOSTS}
  15. ## This docker json should contain both mirror access and official
  16. ## final build docker repository access.
  17. docker_config_json: {from_secret: DOCKER_CONFIG_JSON}
  18. commands:
  19. - |
  20. mkdir -p /root/.ssh
  21. cat <<EOF > /root/.ssh/config
  22. Host git.0k.io
  23. User mirror
  24. Port 10022
  25. EOF
  26. ## Warning: without 'ssh://', the port doesn't see to be used and it tries to
  27. ## connect to git.0k.io:22 (ssh fingerprint allows to infer this).
  28. - DEBUG=1 freeze docker.0k.io git.0k.io:/var/git/mirror
  29. - docker push "$(cat image)" ## this will push the new onbuild image
  30. - (cd odoo && docker build . -t docker.0k.io/mirror/$(cat ../release))
  31. - docker push "docker.0k.io/mirror/$(cat release)"
  32. - |
  33. release=$(cat release)
  34. git checkout -b "tmp"
  35. git commit -am "chg: pkg: release freezing in $release"
  36. git tag "$release"
  37. git push "${DRONE_GIT_SSH_URL}" "$release"
  38. volumes:
  39. - name: docker
  40. host:
  41. path: /var/run/docker.sock
  42. ## Need to configure secret 'dockerconfigjson' in drone secrets to
  43. ## hold a valid config.json file content. These secrets here allow
  44. ## to access 'docker.0k.io/*' images.
  45. image_pull_secrets:
  46. - dockerconfigjson
  47. trigger:
  48. branch:
  49. - test/*
  50. - rc/*
  51. - build/*