From f53d1e57e0591ff01dbc15d6bda01d35ede86437 Mon Sep 17 00:00:00 2001 From: Giles Date: Wed, 23 Sep 2020 20:16:51 +0100 Subject: [PATCH] . --- .drone/drone-home.jsonnet | 6 +++++- .drone/drone-home.yml | 2 +- .drone/lib/initialise-image.sh | 3 +++ .drone/lib/initialise-images.sh | 2 ++ .drone/package.json | 2 +- docker-compose.yml | 4 ++-- 6 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 .drone/lib/initialise-image.sh create mode 100644 .drone/lib/initialise-images.sh diff --git a/.drone/drone-home.jsonnet b/.drone/drone-home.jsonnet index bcafcff..b1503b0 100644 --- a/.drone/drone-home.jsonnet +++ b/.drone/drone-home.jsonnet @@ -4,9 +4,13 @@ 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 config = { + registry: '', +}; [ register, - deploy( + deploy(config)( 'drone', '/stack/', [ diff --git a/.drone/drone-home.yml b/.drone/drone-home.yml index 1d6b56b..3723e64 100644 --- a/.drone/drone-home.yml +++ b/.drone/drone-home.yml @@ -99,7 +99,7 @@ steps: target: /stack/drone - name: wait - image: alpine:3.12.0@sha256:90baa0922fe90624b05cb5766fa5da4e337921656c2f8e2b13bd3c052a0baac1 + image: "%(registry)salpine:3.12.0@sha256:90baa0922fe90624b05cb5766fa5da4e337921656c2f8e2b13bd3c052a0baac1" commands: - sleep 15 diff --git a/.drone/lib/initialise-image.sh b/.drone/lib/initialise-image.sh new file mode 100644 index 0000000..97498b9 --- /dev/null +++ b/.drone/lib/initialise-image.sh @@ -0,0 +1,3 @@ +docker pull $2 \ +&& docker tag $2 $1$2 \ +&& docker push $1$2 \ No newline at end of file diff --git a/.drone/lib/initialise-images.sh b/.drone/lib/initialise-images.sh new file mode 100644 index 0000000..85d44be --- /dev/null +++ b/.drone/lib/initialise-images.sh @@ -0,0 +1,2 @@ +sh $(dirname $0)/initialise-image.sh $1 drone/drone:1.9.0 \ +&& sh $(dirname $0)/initialise-image.sh $1 drone-runner-docker:1.5.0 \ No newline at end of file diff --git a/.drone/package.json b/.drone/package.json index 33bc5f1..54f4792 100644 --- a/.drone/package.json +++ b/.drone/package.json @@ -4,6 +4,6 @@ "build": "drone jsonnet --source drone-home.jsonnet --target drone-home.yml --stream" }, "dependencies": { - "@sigyl/jsonnet-drone": "^0.1.1" + "@sigyl/jsonnet-drone": "^0.2.0" } } diff --git a/docker-compose.yml b/docker-compose.yml index 8856834..3cb708e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: replicas: 1 restart_policy: condition: any - image: drone/drone:1.9.0 + image: ${LOCAL_DOCKER_REGISTRY}drone/drone:1.9.0 volumes: - drone:/var/lib/drone - drone-data:/data @@ -37,7 +37,7 @@ services: replicas: 1 restart_policy: condition: any - image: drone/drone-runner-docker:1.5.0 + image: ${LOCAL_DOCKER_REGISTRY}drone/drone-runner-docker:1.5.0 volumes: - /var/run/docker.sock:/var/run/docker.sock environment: