Skip to content

Commit

Permalink
for multi-arch docker images use the manifest to tag latest and maste…
Browse files Browse the repository at this point in the history
…r images (#1213)

for single arch images allow passing additional tags into the image-tag step and into .tags file
  • Loading branch information
slim-bean authored and cyriltovena committed Oct 30, 2019
1 parent d080e46 commit 38d803a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .drone/docker-manifest.tmpl
Original file line number Diff line number Diff line change
@@ -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}}
Expand Down
6 changes: 3 additions & 3 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ local docker(arch, app) = {
},
};

local arch_image(arch) = {
local arch_image(arch,tags='') = {
platform: {
os: 'linux',
arch: arch,
Expand All @@ -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') {
Expand Down
1 change: 1 addition & 0 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 38d803a

Please sign in to comment.