feat: CI/CD 增加 tag 选择编译环境

This commit is contained in:
2023-08-02 10:41:42 +08:00
parent d23361a9ea
commit dcc4093db9
+5 -1
View File
@@ -23,13 +23,15 @@ default:
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
IMG_TAG=":latest"
else
IMG_TAG=":$CI_COMMIT_REF_SLUG"
IMG_TAG=":$CI_COMMIT_REF_NAME"
fi
- docker login -u "$HARBOR_USERNAME" -p "$HARBOR_PASSWORD" $HARBOR_URL
# 编译阶段任务
build-arm64:
stage: build
tags:
- arm64
script:
- export
- env
@@ -37,6 +39,8 @@ build-arm64:
build-amd64:
stage: build
tags:
- amd64
script:
- docker buildx build --platform=linux/amd64 --pull -t "$IMG_URL$IMG_TAG-linux-amd64" . --push