From a6550663e93418702303d9701700fe4ec487d5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Mon, 11 Sep 2023 13:44:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .codechina-ci.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .codechina-ci.yml diff --git a/.codechina-ci.yml b/.codechina-ci.yml new file mode 100644 index 0000000..69a5e8a --- /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 -- GitLab