From 79a4d6528879792a6cc8fa57cbb4c7ed2aec018f Mon Sep 17 00:00:00 2001 From: Endial Fang Date: Fri, 11 Aug 2023 11:09:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20CI/CD=20=E6=B8=85?= =?UTF-8?q?=E7=90=86=E4=B8=B4=E6=97=B6=E8=B5=84=E6=BA=90=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 70ebbc3..e850088 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,13 +40,15 @@ build-arm64: - arm64 script: - docker buildx build --platform=linux/arm64 --pull -t "$IMG_URL$IMG_TAG-linux-arm64" . --push + - docker rmi "$IMG_URL$IMG_TAG-linux-arm64" build-amd64: stage: build - tags: + tags: - amd64 script: - docker buildx build --platform=linux/amd64 --pull -t "$IMG_URL$IMG_TAG-linux-amd64" . --push + - docker rmi "$IMG_URL$IMG_TAG-linux-amd64" build-artifact: stage: build @@ -54,13 +56,16 @@ build-artifact: script: - docker manifest create "$IMG_URL$IMG_TAG" "$IMG_URL$IMG_TAG-linux-arm64" "$IMG_URL$IMG_TAG-linux-amd64" - docker manifest push "$IMG_URL$IMG_TAG" + - docker manifest rm "$IMG_URL$IMG_TAG" # 测试阶段任务 test: stage: test script: - docker run --rm --platform=linux/arm64 "$IMG_URL$IMG_TAG" /bin/uname -a + - sleep 1 && docker rmi -f "$IMG_URL$IMG_TAG" - docker run --rm --platform=linux/amd64 "$IMG_URL$IMG_TAG" /bin/uname -a + - sleep 1 && docker rmi -f "$IMG_URL$IMG_TAG" # 部署阶段任务 deploy: