From e824ada296d81bf87774336d8ab750dff4415279 Mon Sep 17 00:00:00 2001 From: galal-hussein Date: Mon, 3 Jun 2024 21:04:17 +0300 Subject: [PATCH] Remove drone and add necessary envs to Dapper Signed-off-by: galal-hussein --- .drone.yml | 472 --------------------------------------------- .droneignore | 9 - Dockerfile | 2 +- Dockerfile.windows | 2 +- 4 files changed, 2 insertions(+), 483 deletions(-) delete mode 100644 .drone.yml delete mode 100644 .droneignore diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 3cc92ad7671..00000000000 --- a/.drone.yml +++ /dev/null @@ -1,472 +0,0 @@ ---- -kind: pipeline -type: docker -name: build-amd64 - -platform: - os: linux - arch: amd64 - -clone: - retries: 3 - -steps: - - name: skipfiles - image: plugins/git - commands: - - export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~) - - export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore); - - if [ -z "$DIFF" ]; then - echo "All files in PR are on ignore list"; - exit 78; - else - echo "Some files in PR are not ignored, $DIFF"; - fi; - when: - ref: - include: - - refs/heads/master - - refs/heads/release-* - - refs/pull/** - - - name: validate-release - image: rancher/dapper:v0.5.5 - commands: - - dapper -f Dockerfile --target dapper make validate-release - volumes: - - name: docker - path: /var/run/docker.sock - when: - event: - - tag - instance: - - drone-publish.rancher.io - - - name: build - image: rancher/dapper:v0.5.5 - environment: - ENABLE_REGISTRY: 'true' - AWS_ACCESS_KEY_ID: - from_secret: AWS_ACCESS_KEY_ID-rke2-ci-uploader - AWS_SECRET_ACCESS_KEY: - from_secret: AWS_SECRET_ACCESS_KEY-rke2-ci-uploader - commands: - - docker pull --quiet alpine:3.18 - - dapper -f Dockerfile --target dapper make dapper-ci - volumes: - - name: docker - path: /var/run/docker.sock - when: - ref: - include: - - refs/heads/master - - refs/heads/release-* - - refs/pull/** - - refs/tags/* - - - name: fossa - image: rancher/drone-fossa:latest - failure: ignore - settings: - api_key: - from_secret: FOSSA_API_KEY - when: - instance: - - drone-publish.rancher.io - ref: - include: - - "refs/heads/master" - - "refs/heads/release-*" - - "refs/tags/v*" - - "refs/pull/*" - event: - - push - - tag - - - name: package-images - image: rancher/dapper:v0.5.5 - commands: - - dapper -f Dockerfile --target dapper make package-images - volumes: - - name: docker - path: /var/run/docker.sock - when: - event: - - tag - instance: - - drone-publish.rancher.io - - - name: scan - image: rancher/dapper:v0.5.5 - failure: ignore - commands: - - dapper -f Dockerfile --target dapper make scan-images - volumes: - - name: docker - path: /var/run/docker.sock - when: - instance: - - drone-publish.rancher.io - ref: - include: - - refs/heads/master - - refs/heads/release-* - - refs/tags/* - - - name: test - image: rancher/dapper:v0.5.5 - secrets: [ AWS_ACCESS_KEY_ID-rke2-ci-uploader, AWS_SECRET_ACCESS_KEY-rke2-ci-uploader ] - environment: - ENABLE_REGISTRY: 'true' - AWS_ACCESS_KEY_ID: - from_secret: AWS_ACCESS_KEY_ID-rke2-ci-uploader - AWS_SECRET_ACCESS_KEY: - from_secret: AWS_SECRET_ACCESS_KEY-rke2-ci-uploader - commands: - - dapper -f Dockerfile --target dapper make test - volumes: - - name: docker - path: /var/run/docker.sock - when: - ref: - include: - - refs/heads/master - - refs/heads/release-* - - refs/pull/** - - refs/tags/* - - - name: publish-image-runtime - image: rancher/hardened-build-base:v1.22.2b1 - commands: - - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD - - DRONE_TAG=${DRONE_TAG} make publish-image-runtime - environment: - DOCKER_PASSWORD: - from_secret: docker_password - DOCKER_USERNAME: - from_secret: docker_username - volumes: - - name: docker - path: /var/run/docker.sock - when: - event: - - tag - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - - - name: package-windows-images - image: rancher/dapper:v0.5.5 - commands: - - dapper -f Dockerfile --target dapper make package-windows-images - when: - event: - - tag - instance: - - drone-publish.rancher.io - volumes: - - name: docker - path: /var/run/docker.sock - - - name: publish-dist-artifacts - image: plugins/github-release - settings: - api_key: - from_secret: github_token - checksum: - - sha256 - checksum_file: CHECKSUMsum-amd64.txt - checksum_flatten: true - files: - - dist/artifacts/* - prerelease: true - when: - event: - - tag - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - -volumes: - - name: docker - host: - path: /var/run/docker.sock - ---- -kind: pipeline -type: docker -name: build-arm64 - -platform: - os: linux - arch: arm64 - -clone: - retries: 3 - -steps: - - name: skipfiles - image: plugins/git - commands: - - export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~) - - export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore); - - if [ -z "$DIFF" ]; then - echo "All files in PR are on ignore list"; - exit 78; - else - echo "Some files in PR are not ignored, $DIFF"; - fi; - when: - ref: - include: - - refs/heads/master - - refs/heads/release-* - - refs/pull/** - - - name: validate-release - image: rancher/dapper:v0.5.5 - commands: - - dapper -f Dockerfile --target dapper make validate-release - volumes: - - name: docker - path: /var/run/docker.sock - when: - event: - - tag - instance: - - drone-publish.rancher.io - - - name: build - image: rancher/dapper:v0.5.5 - environment: - ENABLE_REGISTRY: 'true' - AWS_ACCESS_KEY_ID: - from_secret: AWS_ACCESS_KEY_ID-rke2-ci-uploader - AWS_SECRET_ACCESS_KEY: - from_secret: AWS_SECRET_ACCESS_KEY-rke2-ci-uploader - commands: - - docker pull --quiet alpine:3.18 - - dapper -f Dockerfile --target dapper make dapper-ci - volumes: - - name: docker - path: /var/run/docker.sock - when: - ref: - include: - - refs/heads/master - - refs/heads/release-* - - refs/pull/** - - refs/tags/* - - - name: fossa - image: rancher/drone-fossa:latest - failure: ignore - settings: - api_key: - from_secret: FOSSA_API_KEY - when: - instance: - - drone-publish.rancher.io - ref: - include: - - "refs/heads/master" - - "refs/heads/release-*" - - "refs/tags/v*" - - "refs/pull/*" - event: - - push - - tag - - - name: package-images - image: rancher/dapper:v0.5.5 - commands: - - dapper -f Dockerfile --target dapper make package-images - volumes: - - name: docker - path: /var/run/docker.sock - when: - event: - - tag - instance: - - drone-publish.rancher.io - - - name: scan - image: rancher/dapper:v0.5.5 - failure: ignore - commands: - - dapper -f Dockerfile --target dapper make scan-images - volumes: - - name: docker - path: /var/run/docker.sock - when: - instance: - - drone-publish.rancher.io - ref: - include: - - refs/heads/master - - refs/heads/release-* - - refs/tags/* - - - name: publish-image-runtime - image: rancher/hardened-build-base:v1.22.2b1 - commands: - - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD - - DRONE_TAG=${DRONE_TAG} make publish-image-runtime - environment: - DOCKER_PASSWORD: - from_secret: docker_password - DOCKER_USERNAME: - from_secret: docker_username - volumes: - - name: docker - path: /var/run/docker.sock - when: - event: - - tag - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - - - name: publish-dist-artifacts - image: plugins/github-release - settings: - api_key: - from_secret: github_token - checksum: - - sha256 - checksum_file: CHECKSUMsum-arm64.txt - checksum_flatten: true - files: - - dist/artifacts/* - prerelease: true - when: - event: - - tag - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - -volumes: - - name: docker - host: - path: /var/run/docker.sock - ---- -kind: pipeline -type: docker -name: dispatch - -platform: - os: linux - arch: amd64 - -clone: - retries: 3 - -steps: - - name: skipfiles - image: plugins/git - commands: - - export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~) - - export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore); - - if [ -z "$DIFF" ]; then - echo "All files in PR are on ignore list"; - exit 78; - else - echo "Some files in PR are not ignored, $DIFF"; - fi; - when: - ref: - include: - - refs/heads/master - - refs/heads/release-* - - refs/pull/** - - - name: dispatch - image: rancher/dapper:v0.5.5 - commands: - - dapper -f Dockerfile --target dapper make dispatch - environment: - PAT_TOKEN: - from_secret: github_token - PAT_USERNAME: - from_secret: pat_username - volumes: - - name: docker - path: /var/run/docker.sock - when: - event: - - tag - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - -volumes: - - name: docker - host: - path: /var/run/docker.sock - -depends_on: - - build-amd64 - - build-arm64 ---- -kind: pipeline -type: docker -name: manifest - -platform: - os: linux - arch: amd64 - -clone: - retries: 3 - -steps: - - name: skipfiles - image: plugins/git - commands: - - export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~) - - export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore); - - if [ -z "$DIFF" ]; then - echo "All files in PR are on ignore list"; - exit 78; - else - echo "Some files in PR are not ignored, $DIFF"; - fi; - when: - ref: - include: - - refs/heads/master - - refs/heads/release-* - - refs/pull/** - - - name: push-runtime-manifest - image: plugins/manifest - settings: - username: - from_secret: docker_username - password: - from_secret: docker_password - spec: manifest-runtime.tmpl - when: - event: - - tag - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* -depends_on: - - build-amd64 - - build-arm64 -... diff --git a/.droneignore b/.droneignore deleted file mode 100644 index c581c05361c..00000000000 --- a/.droneignore +++ /dev/null @@ -1,9 +0,0 @@ -^.*\.md$ -^install\.sh$ -^\.droneignore$ -^\.github\/.*$ -^MAINTAINERS$ -^CODEOWNERS$ -^LICENSE$ -^DCO$ -^channels\.yaml$ diff --git a/Dockerfile b/Dockerfile index 54f11323d12..cc31ab825e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN zypper install -y systemd-rpm-macros # Dapper/Drone/CI environment FROM build AS dapper -ENV DAPPER_ENV GODEBUG GOCOVER REPO TAG DRONE_TAG PAT_USERNAME PAT_TOKEN KUBERNETES_VERSION DOCKER_BUILDKIT DRONE_BUILD_EVENT IMAGE_NAME AWS_SECRET_ACCESS_KEY AWS_ACCESS_KEY_ID ENABLE_REGISTRY +ENV DAPPER_ENV GODEBUG GOCOVER REPO TAG GITHUB_TAG PAT_USERNAME PAT_TOKEN KUBERNETES_VERSION DOCKER_BUILDKIT DRONE_BUILD_EVENT IMAGE_NAME AWS_SECRET_ACCESS_KEY AWS_ACCESS_KEY_ID ENABLE_REGISTRY ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH ENV DAPPER_OUTPUT ./dist ./bin ./build diff --git a/Dockerfile.windows b/Dockerfile.windows index 7ea129e6c5f..d63b41f7678 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -6,7 +6,7 @@ RUN apk --no-cache add \ # Dapper/Drone/CI environment FROM rancher/hardened-build-base:v1.21.5b2 AS dapper -ENV DAPPER_ENV GODEBUG REPO TAG DRONE_TAG PAT_USERNAME PAT_TOKEN KUBERNETES_VERSION DOCKER_BUILDKIT DRONE_BUILD_EVENT IMAGE_NAME AWS_SECRET_ACCESS_KEY AWS_ACCESS_KEY_ID ENABLE_REGISTRY +ENV DAPPER_ENV GODEBUG REPO TAG GITHUB_TAG PAT_USERNAME PAT_TOKEN KUBERNETES_VERSION DOCKER_BUILDKIT DRONE_BUILD_EVENT IMAGE_NAME AWS_SECRET_ACCESS_KEY AWS_ACCESS_KEY_ID ENABLE_REGISTRY ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH ENV DAPPER_OUTPUT ./dist ./bin ./build