diff --git a/.drone/drone-home.jsonnet b/.drone/drone-home.jsonnet index b1503b0..097562a 100644 --- a/.drone/drone-home.jsonnet +++ b/.drone/drone-home.jsonnet @@ -4,12 +4,23 @@ local publicSecrets = import 'lib/public-secrets.libsonnet'; local deploy = import 'node_modules/@sigyl/jsonnet-drone/deploy.libsonnet'; local register = import 'node_modules/@sigyl/jsonnet-drone/register.libsonnet'; +local registry = import 'node_modules/@sigyl/jsonnet-drone/register.libsonnet'; local config = { registry: '', }; [ register, + registry(config)() { + trigger +: { + event +: [ + 'promote', + ], + target +: [ + 'registry', + ], + }, + }, deploy(config)( 'drone', '/stack/', diff --git a/.drone/drone-home.yml b/.drone/drone-home.yml index 1d6b56b..23fa5b7 100644 --- a/.drone/drone-home.yml +++ b/.drone/drone-home.yml @@ -15,6 +15,56 @@ trigger: exclude: - promote +--- +kind: pipeline +type: docker +name: registry + +platform: + os: linux + arch: amd64 + +steps: +- name: "dockerpull and save docker images:" + image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f + commands: + - set -e + - sleep 40 + - docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${LOCAL_REGISTRY_PASSWORD}" + - "sh .drone/lib/initialise-images.sh " + - docker logout $${LOCAL_DOCKER_REGISTRY} + environment: + LOCAL_DOCKER_REGISTRY: + from_secret: local-docker-registry + LOCAL_REGISTRY_PASSWORD: + from_secret: local-registry-password + volumes: + - name: dockersock + path: /var/run + +services: +- name: docker + image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f + privileged: true + volumes: + - name: dockersock + path: /var/run + - name: ca + path: /etc/docker/certs.d + +volumes: +- name: dockersock + temp: {} +- name: ca + host: + path: /etc/docker/certs.d + +trigger: + event: + - promote + target: + - registry + --- kind: pipeline type: docker