fix:部署

上级 2c7140cc
image: docker:stable
variables:
MAVEN_OPTS: "-Dmaven.repo.local=/root/.m2/repository"
IMAGE_NAME: "chatbox-vue-8888"
stages:
- build
- deploy
cache:
key: ${CI_PROJECT_ID}-${CI_COMMIT_REF_SLUG}
paths:
- ./target
docker-build:
image: maven:3.6.3-openjdk-8
stage: build
script:
- mvn clean package
tags:
- deepexi-belle-dev
only:
- main
docker-deploy:
stage: deploy
cache:
key: ${CI_PROJECT_ID}-${CI_COMMIT_REF_SLUG}
paths:
- ./target
policy: pull
script:
- docker build -t ${IMAGE_NAME} .
- if [ $(docker ps -aq --filter name=^${IMAGE_NAME}$) ]; then docker rm -f ${IMAGE_NAME};fi
- docker run -d --name ${IMAGE_NAME} -p 8888:8888 --restart=always ${IMAGE_NAME}
- if [ $(docker images | grep "none" | awk '{print $3}') ]; then docker rmi $(docker images | grep "none" | awk '{print $3}');fi
tags:
- deepexi-belle-dev
only:
- main
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册