From 4ac9eddea295e828fbe203dafdd67672bb06d398 Mon Sep 17 00:00:00 2001 From: Kiefer Chang Date: Wed, 12 Jul 2023 23:38:21 +0800 Subject: [PATCH] Publish harvester-cluster-repo image Signed-off-by: Kiefer Chang --- .drone.yml | 43 ++++++++++++++++++++++++++++++++++ scripts/package-harvester-repo | 5 ++++ 2 files changed, 48 insertions(+) diff --git a/.drone.yml b/.drone.yml index c766886dc..14c0b88df 100644 --- a/.drone.yml +++ b/.drone.yml @@ -39,6 +39,49 @@ steps: - push - cron +- name: docker-publish-cluster-repo-branch + image: plugins/docker + settings: + context: dist/harvester-cluster-repo + custom_dns: 1.1.1.1 + dockerfile: dist/harvester-cluster-repo/Dockerfile + repo: "rancher/harvester-cluster-repo" + tag: ${DRONE_BRANCH}-head-amd64 + username: + from_secret: docker_username + password: + from_secret: docker_password + when: + instance: + - drone-publish.rancher.io + branch: + - master + - v* + event: + - push + - cron + +- name: manifest-cluster-repo-branch + image: plugins/manifest + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + platforms: + - linux/amd64 + target: "rancher/harvester-cluster-repo:${DRONE_BRANCH}-head" + template: "rancher/harvester-cluster-repo:${DRONE_BRANCH}-head-ARCH" + when: + instance: + - drone-publish.rancher.io + branch: + - master + - v* + event: + - push + - cron + volumes: - name: docker host: diff --git a/scripts/package-harvester-repo b/scripts/package-harvester-repo index 1bb8781de..035cc4153 100755 --- a/scripts/package-harvester-repo +++ b/scripts/package-harvester-repo @@ -2,6 +2,7 @@ TOP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd )" SCRIPTS_DIR="${TOP_DIR}/scripts" +DIST_REPO_DIR="${TOP_DIR}/dist/harvester-cluster-repo" PACKAGE_HARVESTER_OS_DIR="${TOP_DIR}/package/harvester-os" PACKAGE_HARVESTER_REPO_DIR="${TOP_DIR}/package/harvester-repo" BUNDLE_DIR="${PACKAGE_HARVESTER_OS_DIR}/iso/bundle" @@ -13,6 +14,10 @@ mkdir -p ${IMAGES_LISTS_DIR} source ${SCRIPTS_DIR}/version source ${SCRIPTS_DIR}/lib/image +# for image publish in CI +rm -rf ${DIST_REPO_DIR} && mkdir -p ${DIST_REPO_DIR} +cp -r ${PACKAGE_HARVESTER_REPO_DIR}/* ${DIST_REPO_DIR} + cd ${PACKAGE_HARVESTER_REPO_DIR} CLUSTER_REPO_IMAGE=rancher/harvester-cluster-repo:${VERSION}