From 4e68882cfee759fa640512b9c38927d5f9eaaaed Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 9 Oct 2019 11:05:02 +0200 Subject: [PATCH] test multiarch container build --- .drone.jsonnet | 19 +++++++++++++++++++ .drone.yml | 21 ++++++++++++++++++++- manifest.tmpl | 22 ++++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 manifest.tmpl diff --git a/.drone.jsonnet b/.drone.jsonnet index 1cadebd..2b42cbe 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -176,6 +176,7 @@ local PipelineBuildContainer(arch="amd64") = { pull: "always", settings: { auto_tag: true, + auto_tag_suffix: arch, dockerfile: "Dockerfile", repo: "xoxys/ansible-doctor", username: { "from_secret": "docker_username" }, @@ -202,6 +203,24 @@ local PipelineNotifications = { arch: "amd64", }, steps: [ + { + image: "plugins/manifest", + name: "manifest", + pull: "always", + settings: { + ignore_missing: true, + auto_tag: true, + username: { from_secret: "docker_username" }, + password: { from_secret: "docker_password" }, + spec: "manifest.tmpl", + }, + when: { + ref: [ + 'refs/heads/master', + 'refs/tags/**', + ], + }, + }, { name: "matrix", image: "plugins/matrix", diff --git a/.drone.yml b/.drone.yml index 4faf4ff..99e28c4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -195,6 +195,7 @@ steps: image: plugins/docker:linux-amd64 settings: auto_tag: true + auto_tag_suffix: amd64 dockerfile: Dockerfile password: from_secret: docker_password @@ -247,6 +248,7 @@ steps: image: plugins/docker:linux-arm64 settings: auto_tag: true + auto_tag_suffix: arm64 dockerfile: Dockerfile password: from_secret: docker_password @@ -299,6 +301,7 @@ steps: image: plugins/docker:linux-arm settings: auto_tag: true + auto_tag_suffix: arm dockerfile: Dockerfile password: from_secret: docker_password @@ -328,6 +331,22 @@ platform: arch: amd64 steps: +- name: manifest + pull: always + image: plugins/manifest + settings: + auto_tag: true + ignore_missing: true + password: + from_secret: docker_password + spec: manifest.tmpl + username: + from_secret: docker_username + when: + ref: + - refs/heads/master + - "refs/tags/**" + - name: matrix image: plugins/matrix settings: @@ -357,6 +376,6 @@ depends_on: --- kind: signature -hmac: 2db6ebb30be1f686e852ed208db770c956667f430738007d007380eaa81cab82 +hmac: 0c78a7b118aa4b82673105054230952eaf9d17ff590bd3762396910f015e3b76 ... diff --git a/manifest.tmpl b/manifest.tmpl new file mode 100644 index 0000000..3f057b0 --- /dev/null +++ b/manifest.tmpl @@ -0,0 +1,22 @@ +image: xoxys/freshrss:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{ this }} +{{/each}} +{{/if}} +manifests: + - image: xoxys/freshrss:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}-amd64 + platform: + architecture: amd64 + os: linux + + - image: xoxys/freshrss:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}-arm64 + platform: + architecture: arm64 + os: linux + + - image: xoxys/freshrss:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}-arm + platform: + architecture: arm + os: linux