Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
drone: publish manifests for all architectures (#33)
Browse files Browse the repository at this point in the history
Correctly manifest images for all target architectures.

Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
  • Loading branch information
dweomer authored Mar 23, 2021
1 parent 6dd289a commit 2778cc9
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 24 deletions.
84 changes: 60 additions & 24 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ steps:
volumes:
- name: docker
path: /var/run/docker.sock
when:
event:
- push
- pull_request

- name: upload
image: plugins/github-release
Expand All @@ -74,17 +70,19 @@ steps:
- refs/head/master
- refs/tags/*

- name: publish
- name: image-push
image: drone.cattle.io/rancher/kim:possible
pull: never
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} publish
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_BUILDKIT: "1"
GOLANG: drone.cattle.io/rancher/kim:possible
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} image-push
volumes:
- name: docker
path: /var/run/docker.sock
Expand Down Expand Up @@ -128,28 +126,27 @@ steps:
image: drone.cattle.io/rancher/kim:possible
pull: never
environment:
DOCKER_BUILDKIT: "1"
GOLANG: drone.cattle.io/rancher/kim:possible
commands:
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} image
volumes:
- name: docker
path: /var/run/docker.sock
when:
event:
- push
- pull_request

- name: publish
- name: image-push
image: drone.cattle.io/rancher/kim:possible
pull: never
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} publish
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_BUILDKIT: "1"
GOLANG: drone.cattle.io/rancher/kim:possible
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} image-push
volumes:
- name: docker
path: /var/run/docker.sock
Expand Down Expand Up @@ -193,28 +190,27 @@ steps:
image: drone.cattle.io/rancher/kim:possible
pull: never
environment:
DOCKER_BUILDKIT: "1"
GOLANG: drone.cattle.io/rancher/kim:possible
commands:
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} image
volumes:
- name: docker
path: /var/run/docker.sock
when:
event:
- push
- pull_request

- name: publish
- name: image-push
image: drone.cattle.io/rancher/kim:possible
pull: never
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} publish
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_BUILDKIT: "1"
GOLANG: drone.cattle.io/rancher/kim:possible
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} image-push
volumes:
- name: docker
path: /var/run/docker.sock
Expand All @@ -232,4 +228,44 @@ volumes:
host:
path: /var/run/docker.sock

---
kind: pipeline
type: docker
name: manifest

platform:
os: linux
arch: arm

steps:
- name: manifest
image: drone.cattle.io/rancher/kim:possible
pull: never
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_BUILDKIT: "1"
GOLANG: drone.cattle.io/rancher/kim:possible
commands:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- make TAG=${DRONE_TAG:-$(git describe --tags --always)} image-manifest-all
volumes:
- name: docker
path: /var/run/docker.sock
when:
event:
- tag
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*

depends_on:
- amd64
- arm64
- armhf

...
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ image-manifest:
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push \
$(IMG)

.PHONY: image-manifest-all
image-manifest-all:
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create --amend \
$(IMG) \
$(IMG)-amd64 \
$(IMG)-arm64 \
$(IMG)-arm
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push \
$(IMG)

# use this target to test drone builds locally
.PHONY: drone-local
drone-local:
Expand Down

0 comments on commit 2778cc9

Please sign in to comment.