diff --git a/.codechina-ci.yml b/.codechina-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..69a5e8acfdd5f31798ccfce90ed2f28613643863 --- /dev/null +++ b/.codechina-ci.yml @@ -0,0 +1,41 @@ +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