Commit 46c6850f authored by mingyard's avatar mingyard

feat:gitlab

parent 4be5d60a
image: docker:stable
variables:
IMAGE_NAME: "work-server"
IMAGE_TAG: "prod"
TITLE: "translation-server正式环境更新"
CONTENT: ${CI_COMMIT_TITLE// /-}
VIEW_URL: "https://beta.laihua.com"
PIPELINES_URL: "https://gitlab.laihua.com/qinmingyuan/translation-server/pipelines"
# 定义阶段的执行顺序 分为 3个阶段
stages:
- stage-test
- stage-build
- stage-deploy
- stage-cleanup
test_job:
stage: stage-test
tags:
- admin-api-runner
only:
- release
script:
- echo "开始单元测试..."
- echo "单元测试完成!"
docker_job:
stage: stage-build
tags:
- admin-api-runner
only:
- release
script:
- echo "开始docker镜像构建..."
- docker login -u $CN_HUAWEIYUNAK -p $CN_HUAWEIYUNSK swr.cn-south-1.myhuaweicloud.com;
- echo "Tagging Docker image..."
- docker build -t swr.cn-south-1.myhuaweicloud.com/laihua-swr/${IMAGE_NAME}:${IMAGE_TAG} .
- echo "Pushing Docker image..."
- docker push swr.cn-south-1.myhuaweicloud.com/laihua-swr/${IMAGE_NAME}:${IMAGE_TAG}
- echo "docker镜像构建完成!"
when: manual
allow_failure: false
deploy_job:
stage: stage-deploy
tags:
- admin-api-runner
only:
- release
script:
- echo "请在rancher中部署..."
dependencies:
- docker_job
cleanup_job:
stage: stage-cleanup
script:
- sudo rm -rf ./node_modules
when: on_failure
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment