Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop

This commit is contained in:
sk 2024-10-15 08:57:50 +08:00
commit 6071106264
1 changed files with 15 additions and 7 deletions

View File

@ -1,6 +1,7 @@
stages:
- build
- deploy
- push
variables:
ProjectPath: "mongo.games.com/game"
@ -13,6 +14,7 @@ default:
build-job:
stage: build
script:
- git checkout $CI_COMMIT_REF_NAME
# 拷贝到GOPATH
- echo '拷贝到GOPATH'
- cp -rfp ./* $GOPATH/src/$ProjectPath
@ -29,12 +31,16 @@ build-job:
go build -v
cd ..
done < shell/programs.txt
only:
- develop
deploy-job:
stage: deploy
script:
# 拉取
- echo "拉取deploy"
- cd $GOPATH/src/$DeployPath
- git checkout $CI_COMMIT_REF_NAME
- git pull
# 拷贝data目录
- echo '拷贝data目录'
- cd $GOPATH/src/$ProjectPath
@ -60,12 +66,14 @@ deploy-job:
rm -rf $line/$line
done < shell/programs.txt
push_job:
stage: push
script:
# 提交代码
- echo '提交代码'
- cd $GOPATH/src/$DeployPath
- git config user.email "ci@example.com" # 设置提交者的 email
- git config user.name "GitLab CI" # 设置提交者的名称
- git add .
- git commit -m "auto commit pipelineId\:$CI_PIPELINE_ID"
- git push origin develop
only:
- develop
- git commit -m "auto commit pipelineId $CI_PIPELINE_ID"
- git push origin $CI_COMMIT_REF_NAME