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