From e369cbb2359c14dd4b11c5ffd2cee58cc6654be3 Mon Sep 17 00:00:00 2001 From: Giles Bradshaw Date: Fri, 23 Oct 2020 20:22:53 +0100 Subject: [PATCH] feat: drone-images --- .drone/drone-home.jsonnet | 3 +- .drone/drone-home.yml | 83 +++++++++++++++++++++++++++++++++++++++ .drone/package.json | 2 +- 3 files changed, 86 insertions(+), 2 deletions(-) diff --git a/.drone/drone-home.jsonnet b/.drone/drone-home.jsonnet index 04393ac..530562c 100644 --- a/.drone/drone-home.jsonnet +++ b/.drone/drone-home.jsonnet @@ -8,6 +8,7 @@ local registry = import 'node_modules/@sigyl/jsonnet-drone/registry.libsonnet'; local save = import 'node_modules/@sigyl/jsonnet-drone/save.libsonnet'; local build = import 'node_modules/@sigyl/jsonnet-drone/build.libsonnet'; local print = import 'node_modules/@sigyl/jsonnet-drone/print.libsonnet'; +local droneImages = import 'node_modules/@sigyl/jsonnet-drone/drone-images.libsonnet'; local config = { registry: '', @@ -50,7 +51,7 @@ local defs = [ build(config)( [], ), - + droneImages(config), deploy(config)( [ 'REGISTRY_DOMAIN', diff --git a/.drone/drone-home.yml b/.drone/drone-home.yml index a88a326..ef6cdbf 100644 --- a/.drone/drone-home.yml +++ b/.drone/drone-home.yml @@ -300,6 +300,89 @@ trigger: target: - build +--- +kind: pipeline +type: docker +name: drone-images + +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 /stack/.images/drone/drone-images + - rm -f /stack/.images/drone/drone-images/*.* + +- name: docker + image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea + settings: + envs: + - drone_tag + - drone_commit + - drone_build_number + - drone_repo_name + - drone_repo_namespace + - registry_domain + - registry_port + - registry_password + script: + - docker pull docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f + - docker save docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f -o /stack/.images/drone/drone-images/docker.tar + - echo "docker load docker.tar" >> /stack/.images/drone/drone-images/load.sh + +- name: scp + image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea + settings: + envs: + - drone_tag + - drone_commit + - drone_build_number + - drone_repo_name + - drone_repo_namespace + - registry_domain + - registry_port + - registry_password + script: + - docker pull appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47 + - docker save appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47 -o /stack/.images/drone/drone-images/scp.tar + - echo "docker load scp.tar" >> /stack/.images/drone/drone-images/load.sh + +- name: ssh + image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea + settings: + envs: + - drone_tag + - drone_commit + - drone_build_number + - drone_repo_name + - drone_repo_namespace + - registry_domain + - registry_port + - registry_password + script: + - docker pull appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea + - docker save appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea -o /stack/.images/drone/drone-images/ssh.tar + - echo "docker load ssh.tar" >> /stack/.images/drone/drone-images/load.sh + +trigger: + event: + - promote + target: + - drone-images + --- kind: pipeline type: docker diff --git a/.drone/package.json b/.drone/package.json index ba6f1ee..552964d 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.4.5" + "@sigyl/jsonnet-drone": "^0.4.6" } }