From 9362979e13fc1114904f68e56792a8c5a6ad7deb Mon Sep 17 00:00:00 2001 From: Nils Jakobi Date: Sun, 3 Jan 2021 17:03:09 +0100 Subject: [PATCH] added manifest feature --- .drone.jsonnet | 38 ++++++++++++++++++++++++++++++++------ Dockerfile | 2 +- manifest.yml | 19 +++++++++++++++++++ 3 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 manifest.yml diff --git a/.drone.jsonnet b/.drone.jsonnet index caa14d8..367204b 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,6 +1,10 @@ local pipeline(os, arch) = { kind: "pipeline", - name: "build " + os + "/" + arch, + name: os + "/" + arch, + platform: { + "os": os, + "arch": arch, + }, steps: [{ name: "compile " + os + "/" + arch, image: "golang:1.15.6-alpine3.12", @@ -34,7 +38,7 @@ local pipeline(os, arch) = { username: { "from_secret": "docker_username" }, password: { "from_secret": "docker_password" }, auto_tag: true, - //auto_tag_suffix: os + "-" + arch + auto_tag_suffix: os + "-" + arch }, when: { event: "tag" @@ -43,10 +47,32 @@ local pipeline(os, arch) = { ], }; +local manifest() = { + kind: "pipeline", + type: "docker", + name: "manifest", + depends_on: ["linux/arm64", "linux/amd64"], + when: { + event: "tag" + }, + + steps: [ + { + name: "publish", + image: "plugins/manifest", + settings: { + auto_tag: true, + ignore_missing: true, + spec: "manifest.yml", + username: { "from_secret": "docker_username" }, + password: { "from_secret": "docker_password" }, + }, + }, + ], +}; + [ pipeline("linux", "amd64"), - // pipeline("linux", "arm64"), - // pipeline("darwin", "amd64"), - // pipeline("darwin", "arm64"), - // pipeline("windows", "amd64"), + pipeline("linux", "arm64"), + manifest() ] \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9f8d942..2d1631b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.12.3 +FROM alpine WORKDIR /opt/ ADD ./release/*/*/ubnt-freifunk-map-api /opt/ubnt-freifunk-map-api diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 0000000..05d855f --- /dev/null +++ b/manifest.yml @@ -0,0 +1,19 @@ +image: fftdf/ffmap-ubnt-api:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: + - "latest" +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - + image: fftdf/ffmap-ubnt-api:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - + image: fftdf/ffmap-ubnt-api:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 + platform: + architecture: arm64 + os: linux \ No newline at end of file