This commit is contained in:
Giles Bradshaw 2020-09-24 10:13:28 +01:00
parent c66ca53b0d
commit 89a9f56841
2 changed files with 61 additions and 0 deletions

View File

@ -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/',

View File

@ -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