feat: 增加 CI/CD 清理临时资源处理

This commit is contained in:
2023-08-11 11:09:40 +08:00
parent 165aaa2e50
commit 79a4d65288
+6 -1
View File
@@ -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: