Skip to content

Commit

Permalink
enable arm builds
Browse files Browse the repository at this point in the history
drone pipeline changes to enable and publish arm images
  • Loading branch information
ibrokethecloud committed Dec 20, 2023
1 parent 9f6ce93 commit 0aa0710
Show file tree
Hide file tree
Showing 2 changed files with 290 additions and 9 deletions.
294 changes: 288 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ steps:
password:
from_secret: docker_password
repo: "rancher/harvester-network-controller"
tag: ${DRONE_BRANCH}-head
tag: ${DRONE_BRANCH}-head-linux-amd64
username:
from_secret: docker_username
when:
Expand All @@ -46,7 +46,7 @@ steps:
password:
from_secret: docker_password
repo: "rancher/harvester-network-helper"
tag: ${DRONE_BRANCH}-head
tag: ${DRONE_BRANCH}-head-linux-amd64
username:
from_secret: docker_username
when:
Expand All @@ -67,7 +67,7 @@ steps:
password:
from_secret: docker_password
repo: "rancher/harvester-network-webhook"
tag: ${DRONE_BRANCH}-head
tag: ${DRONE_BRANCH}-head-linux-amd64
username:
from_secret: docker_username
when:
Expand All @@ -85,7 +85,7 @@ steps:
password:
from_secret: docker_password
repo: "rancher/harvester-network-controller"
tag: "${DRONE_TAG}"
tag: "${DRONE_TAG}-linux-amd64"
username:
from_secret: docker_username
when:
Expand All @@ -104,7 +104,7 @@ steps:
password:
from_secret: docker_password
repo: "rancher/harvester-network-helper"
tag: "${DRONE_TAG}"
tag: "${DRONE_TAG}-linux-amd64"
username:
from_secret: docker_username
when:
Expand All @@ -123,7 +123,7 @@ steps:
password:
from_secret: docker_password
repo: "rancher/harvester-network-webhook"
tag: "${DRONE_TAG}"
tag: "${DRONE_TAG}-linux-amd64"
username:
from_secret: docker_username
when:
Expand All @@ -139,3 +139,285 @@ volumes:
- name: docker
host:
path: /var/run/docker.sock

---
kind: pipeline
name: arm64

platform:
os: linux
arch: arm64

steps:
- name: build
image: rancher/dapper:v0.5.7
commands:
- dapper ci
volumes:
- name: docker
path: /var/run/docker.sock

- name: docker-publish-master
image: plugins/docker
settings:
build_args:
- ARCH=arm64
- VERSION=${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}-head
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/harvester-network-controller"
tag: ${DRONE_BRANCH}-head-linux-arm64
username:
from_secret: docker_username
when:
ref:
include:
- "refs/heads/master"
- "refs/heads/release/v*"
event:
- push

- name: docker-publish-master-helper
image: plugins/docker
settings:
build_args:
- ARCH=arm64
- VERSION=${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}-head
dockerfile: package/Dockerfile.helper
password:
from_secret: docker_password
repo: "rancher/harvester-network-helper"
tag: ${DRONE_BRANCH}-head-linux-arm64
username:
from_secret: docker_username
when:
ref:
include:
- "refs/heads/master"
- "refs/heads/release/v*"
event:
- push

- name: docker-publish-master-webhook
image: plugins/docker
settings:
build_args:
- ARCH=arm64
- VERSION=${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}-head
dockerfile: package/Dockerfile.webhook
password:
from_secret: docker_password
repo: "rancher/harvester-network-webhook"
tag: ${DRONE_BRANCH}-head-linux-arm64
username:
from_secret: docker_username
when:
ref:
include:
- "refs/heads/master"
- "refs/heads/release/v*"
event:
- push

- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/harvester-network-controller"
tag: "${DRONE_TAG}-linux-arm64"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

- name: docker-publish-helper
image: plugins/docker
settings:
dockerfile: package/Dockerfile.helper
password:
from_secret: docker_password
repo: "rancher/harvester-network-helper"
tag: "${DRONE_TAG}-linux-arm64"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

- name: docker-publish-webhook
image: plugins/docker
settings:
dockerfile: package/Dockerfile.webhook
password:
from_secret: docker_password
repo: "rancher/harvester-network-webhook"
tag: "${DRONE_TAG}-linux-arm64"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

volumes:
- name: docker
host:
path: /var/run/docker.sock

---
kind: pipeline
name: manifest

env:
IMAGE_NAME: "rancher/harvester-network-controller"
WEBHOOK_IMAGE_NAME: "rancher/harvester-network-webhook"
HELPER_IMAGE_NAME: "rancher/harvester-network-helper"

steps:
- name: push-manifest-head
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
target: "${IMAGE_NAME}:${DRONE_BRANCH}-head"
template: "${IMAGE_NAME}:${DRONE_BRANCH}-head-OS-ARCH"
ignore_missing: true
platforms:
- linux/amd64
- linux/arm64
when:
ref:
include:
- refs/heads/master
- refs/heads/release/v*
event:
- push

- name: push-manifest-tag
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
target: "${IMAGE_NAME}:${DRONE_TAG}"
template: "${IMAGE_NAME}:${DRONE_TAG}-OS-ARCH"
ignore_missing: true
platforms:
- linux/amd64
- linux/arm64
when:
ref:
include:
- refs/head/master
- refs/tags/*
event:
- tag

- name: push-webhook-manifest-head
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
target: "${WEBHOOK_IMAGE_NAME}:${DRONE_BRANCH}-head"
template: "${WEBHOOK_IMAGE_NAME}:${DRONE_BRANCH}-head-OS-ARCH"
ignore_missing: true
platforms:
- linux/amd64
- linux/arm64
when:
ref:
include:
- refs/heads/master
- refs/heads/release/v*
event:
- push

- name: push-webhook-manifest-tag
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
target: "${WEBHOOK_IMAGE_NAME}:${DRONE_TAG}"
template: "${WEBHOOK_IMAGE_NAME}:${DRONE_TAG}-OS-ARCH"
ignore_missing: true
platforms:
- linux/amd64
- linux/arm64
when:
ref:
include:
- refs/head/master
- refs/tags/*
event:
- tag

- name: push-helper-manifest-head
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
target: "${HELPER_IMAGE_NAME}:${DRONE_BRANCH}-head"
template: "${HELPER_IMAGE_NAME}:${DRONE_BRANCH}-head-OS-ARCH"
ignore_missing: true
platforms:
- linux/amd64
- linux/arm64
when:
ref:
include:
- refs/heads/master
- refs/heads/release/v*
event:
- push

- name: push-helper-manifest-tag
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
target: "${HELPER_IMAGE_NAME}:${DRONE_TAG}"
template: "${HELPER_IMAGE_NAME}:${DRONE_TAG}-OS-ARCH"
ignore_missing: true
platforms:
- linux/amd64
- linux/arm64
when:
ref:
include:
- refs/head/master
- refs/tags/*
event:
- tag

depends_on:
- amd64
- arm64
5 changes: 2 additions & 3 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
RUN zypper -n rm container-suseconnect && \
zypper -n install git curl docker gzip tar wget awk

RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.49.0; \
fi
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.49.0


ENV DAPPER_ENV REPO TAG DRONE_TAG
ENV DAPPER_SOURCE /go/src/github.com/harvester/harvester-network-controller/
Expand Down

0 comments on commit 0aa0710

Please sign in to comment.