From bb5c65bc32f5caa8236d95e63b51a49ef2aa35e3 Mon Sep 17 00:00:00 2001 From: Gaurav Mehta Date: Wed, 20 Dec 2023 13:11:25 +1100 Subject: [PATCH] enable ci for arm enable drone ci for arm builds and update dapper to not check for processor types --- .drone.yml | 190 ++++++++++++++++++++++++++++++++-------------- Dockerfile.dapper | 10 +-- 2 files changed, 136 insertions(+), 64 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4e1fac55..97f5a6e0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,67 +7,141 @@ platform: arch: amd64 steps: -- name: fetch - image: alpine/git - commands: - - git fetch --tags - when: - instance: - - drone-publish.rancher.io - ref: - - refs/tags/* - event: - - tag + - name: fetch + image: alpine/git + commands: + - git fetch --tags + when: + instance: + - drone-publish.rancher.io + ref: + - refs/tags/* + event: + - tag -- name: build - image: rancher/dapper:v0.5.8 - commands: - - dapper ci - volumes: + - name: build + image: rancher/dapper:v0.5.8 + commands: + - dapper ci + volumes: + - name: docker + path: /var/run/docker.sock + + - name: docker-publish-master + image: plugins/docker + settings: + build_args: + - ARCH=amd64 + - VERSION=${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}-head + dockerfile: package/Dockerfile + password: + from_secret: docker_password + repo: "rancher/harvester-node-disk-manager" + tag: ${DRONE_BRANCH}-head + 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-node-disk-manager" + tag: "${DRONE_TAG}" + username: + from_secret: docker_username + when: + instance: + - drone-publish.rancher.io + ref: + - refs/head/master + - refs/tags/* + event: + - tag + +volumes: - name: docker - path: /var/run/docker.sock + host: + path: /var/run/docker.sock + +--- +kind: pipeline +name: arm64 -- name: docker-publish-master - image: plugins/docker - settings: - build_args: - - ARCH=amd64 - - VERSION=${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}-head - dockerfile: package/Dockerfile - password: - from_secret: docker_password - repo: "rancher/harvester-node-disk-manager" - tag: ${DRONE_BRANCH}-head - username: - from_secret: docker_username - when: - ref: - include: - - refs/heads/master - - refs/heads/release/v* - event: - - push +platform: + os: linux + arch: arm64 + +steps: + - name: fetch + image: alpine/git + commands: + - git fetch --tags + when: + instance: + - drone-publish.rancher.io + ref: + - refs/tags/* + event: + - tag -- name: docker-publish - image: plugins/docker - settings: - dockerfile: package/Dockerfile - password: - from_secret: docker_password - repo: "rancher/harvester-node-disk-manager" - tag: "${DRONE_TAG}" - username: - from_secret: docker_username - when: - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - event: - - tag + - name: build + image: rancher/dapper:v0.5.8 + 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-node-disk-manager" + tag: ${DRONE_BRANCH}-head + 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-node-disk-manager" + tag: "${DRONE_TAG}" + 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 + - name: docker + host: + path: /var/run/docker.sock diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 307a603b..f710dc12 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -7,14 +7,12 @@ RUN zypper -n rm container-suseconnect && \ zypper -n install git curl docker gzip tar wget awk ## install golangci -RUN if [ "${ARCH}" == "amd64" ]; then \ - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.52.0; \ - fi +RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.52.0 ## install controller-gen -RUN if [ "${ARCH}" = "amd64" ]; then \ - go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.2; \ - fi + +RUN go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.2 + # install openapi-gen RUN go install k8s.io/code-generator/cmd/openapi-gen@v0.23.7