variables: REGISTRY: micr.cloud.mioffice.cn IMAGE_NAME: micr.cloud.mioffice.cn/egg/egg_server MATRIX_PROJECT: 462609 MATRIX_SPACE: egg-server-prev MATRIX_AK: CAKBCYGR0BI2BGMVUF8 stages: - build - deploy default: tags: - itp-yingbo-wh build: stage: build only: - master image: docker:latest services: - docker:dind script: - docker login -u $MATRIX_AK -p $MATRIX_SK $REGISTRY - docker build -t $IMAGE_NAME:$CI_COMMIT_SHA -f ./docker/deploy/Dockerfile . - docker push $IMAGE_NAME:$CI_COMMIT_SHA - docker logout $REGISTRY - docker rmi $IMAGE_NAME:$CI_COMMIT_SHA deploy: stage: deploy only: - master when: manual image: cr.d.xiaomi.net/bigdata-fe/matrix-cli script: - matrix-cli config set --access-key $MATRIX_AK --secret-key $MATRIX_SK - matrix-cli deploy --project $MATRIX_PROJECT --deploy-space $MATRIX_SPACE --reason "$CI_COMMIT_MESSAGE" --deploy-percentage 1 --tag $CI_COMMIT_SHA