This commit is contained in:
Giles Bradshaw 2020-10-22 21:16:14 +01:00
parent 0080f24b79
commit 7a0f4c3f12
2 changed files with 99 additions and 14 deletions

View File

@ -4,31 +4,33 @@ 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/registry.libsonnet';
local save = import 'node_modules/@sigyl/jsonnet-drone/save.libsonnet';
local config = {
registry: '',
};
local defs = [
{
load: 'postgres:12.4',
save: 'postgres:12.4'
},
{
load: 'guacamole/guacd:1.2.0',
save: 'guacamole/guacd:1.2.0',
},
{
load: 'guacamole/guacamole:1.2.0',
save: 'guacamole/guacamole:1.2.0',
},
];
[
register,
registry(
config {
// script: 'sh .drone/scripts/initialise-images.sh',
secrets: [],
images: [
{
load: 'postgres:12.4',
save: 'postgres:12.4'
},
{
load: 'guacamole/guacd:1.2.0',
save: 'guacamole/guacd:1.2.0',
},
{
load: 'guacamole/guacamole:1.2.0',
save: 'guacamole/guacamole:1.2.0',
},
],
images: defs,
},
) {
trigger +: {
@ -40,6 +42,19 @@ local config = {
],
},
},
save(config)(
'guacamole',
defs,
) {
trigger +: {
event +: [
'promote',
],
target +: [
'save',
],
},
},
deploy(config)(
'guacamole',
'/stack/',

View File

@ -94,6 +94,76 @@ kind: pipeline
type: docker
name: deploy
platform:
os: linux
arch: amd64
clone:
disable: true
steps:
- name: mkdir
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
settings:
envs:
- drone_tag
- drone_commit
- drone_build_number
- drone_repo_name
- drone_repo_namespace
script:
- mkdir -p /root/images/guacamole
- name: postgres:12.4
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
settings:
envs:
- drone_tag
- drone_commit
- drone_build_number
- drone_repo_name
- drone_repo_namespace
script:
- "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n"
- echo postgres:12.4
- name: guacamole/guacd:1.2.0
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
settings:
envs:
- drone_tag
- drone_commit
- drone_build_number
- drone_repo_name
- drone_repo_namespace
script:
- "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n"
- echo guacamole/guacd:1.2.0
- name: guacamole/guacamole:1.2.0
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
settings:
envs:
- drone_tag
- drone_commit
- drone_build_number
- drone_repo_name
- drone_repo_namespace
script:
- "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n"
- echo guacamole/guacamole:1.2.0
trigger:
event:
- promote
target:
- save
---
kind: pipeline
type: docker
name: deploy
platform:
os: linux
arch: amd64