Created
October 29, 2021 09:40
-
-
Save ondrejmo/8928807c9d1c9f67bb567c338078784c to your computer and use it in GitHub Desktop.
Drone CI pipeline for building multiplatform images with kube-runner and podman
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
kind: pipeline | |
type: kubernetes | |
name: linux-amd64 | |
trigger: | |
ref: | |
include: | |
- refs/tags/myapp-* | |
event: | |
- tag | |
- custom | |
node_selector: | |
kubernetes.io/arch: amd64 | |
clone: | |
skip_verify: yes | |
depth: 1 | |
steps: | |
- name: build & push | |
image: quay.io/podman/stable:v3.3.1 | |
privileged: yes | |
commands: | |
- | | |
cat > /etc/containers/registries.conf.d/wolfpack.conf <<EOF | |
[[registry]] | |
location="registry.local:5000" | |
insecure=true | |
EOF | |
- podman build -t myapp:${DRONE_TAG##*-}-linux-amd64 . | |
- podman push myapp:${DRONE_TAG##*-}-linux-amd64 docker://registry.local:5000/myapp:${DRONE_TAG##*-}-linux-amd64 | |
--- | |
kind: pipeline | |
type: kubernetes | |
name: linux-arm64 | |
trigger: | |
ref: | |
include: | |
- refs/tags/myapp-* | |
event: | |
- tag | |
- custom | |
node_selector: | |
kubernetes.io/arch: arm64 | |
clone: | |
skip_verify: yes | |
depth: 1 | |
steps: | |
- name: build & push | |
image: quay.io/podman/stable:v3.3.1 | |
privileged: yes | |
commands: | |
- | | |
cat > /etc/containers/registries.conf.d/wolfpack.conf <<EOF | |
[[registry]] | |
location="registry.local:5000" | |
insecure=true | |
EOF | |
- podman build -t myapp:${DRONE_TAG##*-}-linux-arm64 . | |
- podman push myapp:${DRONE_TAG##*-}-linux-arm64 docker://registry.local:5000/myapp:${DRONE_TAG##*-}-linux-arm64 | |
--- | |
kind: pipeline | |
type: kubernetes | |
name: manifest | |
trigger: | |
ref: | |
include: | |
- refs/tags/myapp-* | |
event: | |
- tag | |
- custom | |
clone: | |
disable: yes | |
steps: | |
- name: create & push | |
image: quay.io/podman/stable:v3.3.1 | |
privileged: true | |
commands: | |
- | | |
cat > /etc/containers/registries.conf.d/wolfpack.conf <<EOF | |
[[registry]] | |
location="registry.local:5000" | |
insecure=true | |
EOF | |
- podman manifest create myapp:${DRONE_TAG##*-} registry.local:5000/myapp:${DRONE_TAG##*-}-linux-amd64 registry.local:5000/myapp:${DRONE_TAG##*-}-linux-arm64 | |
- podman manifest push myapp:${DRONE_TAG##*-} docker://registry.local:5000/myapp:${DRONE_TAG##*-} | |
depends_on: | |
- linux-amd64 | |
- linux-arm64 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Better version of https://gist.github.com/ondrejmo/2cf8e1a6d9b016a95a5b440cd926b6fd
Improvements