From b62f7764d81cc4ef6eecbb23554055db108bb3e7 Mon Sep 17 00:00:00 2001 From: Edward Welch Date: Tue, 29 Oct 2019 18:15:45 -0400 Subject: [PATCH] for multi-arch docker images use the manifest to tag latest and master images for single arch images allow passing additional tags into the image-tag step and into .tags file --- .drone/docker-manifest.tmpl | 4 +++- .drone/drone.jsonnet | 6 +++--- .drone/drone.yml | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.drone/docker-manifest.tmpl b/.drone/docker-manifest.tmpl index 54f26489e1a7e..d66ac2fd05352 100644 --- a/.drone/docker-manifest.tmpl +++ b/.drone/docker-manifest.tmpl @@ -1,6 +1,8 @@ image: grafana/{{config.target}}:{{#if build.tag}}{{build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}} -{{#if build.tags}} tags: + - latest + - master +{{#if build.tags}} {{#each build.tags}} - {{this}} {{/each}} diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet index a727442f9bd7e..764fc20bc5e33 100644 --- a/.drone/drone.jsonnet +++ b/.drone/drone.jsonnet @@ -43,7 +43,7 @@ local docker(arch, app) = { }, }; -local arch_image(arch) = { +local arch_image(arch,tags='') = { platform: { os: 'linux', arch: arch, @@ -55,11 +55,11 @@ local arch_image(arch) = { 'apk add --no-cache bash git', 'git fetch origin --tags', 'echo $(./tools/image-tag)-%s > .tags' % arch, - ], + ] + if tags != '' then ['echo ",%s" >> .tags' % tags] else [], }], }; -local fluentbit() = pipeline('fluent-bit-amd64') + arch_image('amd64') { +local fluentbit() = pipeline('fluent-bit-amd64') + arch_image('amd64','latest,master') { steps+: [ // dry run for everything that is not tag or master docker('amd64', 'fluent-bit') { diff --git a/.drone/drone.yml b/.drone/drone.yml index 96c42f734d3da..c3dfacb6b19da 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -394,6 +394,7 @@ steps: - apk add --no-cache bash git - git fetch origin --tags - echo $(./tools/image-tag)-amd64 > .tags + - echo ",latest,master" >> .tags image: alpine name: image-tag - depends_on: