diff --git a/.drone.yml b/.drone.yml index 47a68eac..ea8abf33 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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 \ No newline at end of file diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 688dd960..ac9eaaa7 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -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/