From 83baeae5662f2f26f1789bafdadff9892d693136 Mon Sep 17 00:00:00 2001 From: skeleton Date: Mon, 14 Oct 2024 09:51:11 +0000 Subject: [PATCH 1/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0.gitlab-ci.yml=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2dcfdd8..03174ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,8 +29,6 @@ build-job: go build -v cd .. done < shell/programs.txt - only: - - develop deploy-job: stage: deploy @@ -65,7 +63,4 @@ deploy-job: - cd $GOPATH/src/$DeployPath - git add . - git commit -m "auto commit pipelineId\:$CI_PIPELINE_ID" - - git push origin develop - only: - - develop - + - git push origin develop \ No newline at end of file From 72b84433722df70a5f3086eecd02441a19bed7d0 Mon Sep 17 00:00:00 2001 From: skeleton Date: Mon, 14 Oct 2024 10:03:44 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0.gitlab-ci.yml=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03174ee..be37d80 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - build - deploy + - push variables: ProjectPath: "mongo.games.com/game" @@ -58,6 +59,9 @@ deploy-job: rm -rf $line/$line done < shell/programs.txt +push_job: + stage: push + script: # 提交代码 - echo '提交代码' - cd $GOPATH/src/$DeployPath From beb0137480306b54279b3b59765a7c27fa607690 Mon Sep 17 00:00:00 2001 From: skeleton Date: Mon, 14 Oct 2024 10:12:57 +0000 Subject: [PATCH 3/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0.gitlab-ci.yml=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be37d80..300324d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -65,6 +65,7 @@ push_job: # 提交代码 - echo '提交代码' - cd $GOPATH/src/$DeployPath + - git checkout $CI_COMMIT_REF_NAME - git add . - git commit -m "auto commit pipelineId\:$CI_PIPELINE_ID" - git push origin develop \ No newline at end of file From e6b7fa1fea21ec35c1b0b66ca2483ab0a9db9d34 Mon Sep 17 00:00:00 2001 From: skeleton Date: Mon, 14 Oct 2024 10:16:57 +0000 Subject: [PATCH 4/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0.gitlab-ci.yml=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 300324d..dd74fa4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,7 @@ default: build-job: stage: build script: + - git checkout $CI_COMMIT_REF_NAME # 拷贝到GOPATH - echo '拷贝到GOPATH' - cp -rfp ./* $GOPATH/src/$ProjectPath From 9075f60b3f67fed4f865e01a6de3737a6389c0a5 Mon Sep 17 00:00:00 2001 From: skeleton Date: Mon, 14 Oct 2024 11:42:36 +0000 Subject: [PATCH 5/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0.gitlab-ci.yml=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dd74fa4..ceae477 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -65,6 +65,8 @@ push_job: script: # 提交代码 - echo '提交代码' + - git config user.email "ci@example.com" # 设置提交者的 email + - git config user.name "GitLab CI" # 设置提交者的名称 - cd $GOPATH/src/$DeployPath - git checkout $CI_COMMIT_REF_NAME - git add . From 0207cb2f5378a76dbd3952693873c8949ff7910b Mon Sep 17 00:00:00 2001 From: skeleton Date: Mon, 14 Oct 2024 11:44:43 +0000 Subject: [PATCH 6/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0.gitlab-ci.yml=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ceae477..1604bcf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -67,8 +67,7 @@ push_job: - echo '提交代码' - git config user.email "ci@example.com" # 设置提交者的 email - git config user.name "GitLab CI" # 设置提交者的名称 - - cd $GOPATH/src/$DeployPath - git checkout $CI_COMMIT_REF_NAME - git add . - - git commit -m "auto commit pipelineId\:$CI_PIPELINE_ID" - - git push origin develop \ No newline at end of file + - git commit -m "auto commit pipelineId $CI_PIPELINE_ID" + - git push origin $CI_COMMIT_REF_NAME \ No newline at end of file From 85d1456623f66172dada1316129cd92035a82eff Mon Sep 17 00:00:00 2001 From: skeleton Date: Mon, 14 Oct 2024 11:48:42 +0000 Subject: [PATCH 7/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0.gitlab-ci.yml=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1604bcf..56cb3c9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,6 +35,12 @@ build-job: 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 @@ -65,9 +71,9 @@ push_job: script: # 提交代码 - echo '提交代码' + - cd $GOPATH/src/$DeployPath - git config user.email "ci@example.com" # 设置提交者的 email - git config user.name "GitLab CI" # 设置提交者的名称 - - git checkout $CI_COMMIT_REF_NAME - git add . - git commit -m "auto commit pipelineId $CI_PIPELINE_ID" - git push origin $CI_COMMIT_REF_NAME \ No newline at end of file