Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
translation-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinmingyuan
translation-server
Commits
34dbe4e4
Commit
34dbe4e4
authored
Jan 11, 2025
by
mingyard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:git ci rancher 自动部署
parent
6c09e710
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
.gitlab-ci.yml
.gitlab-ci.yml
+8
-1
No files found.
.gitlab-ci.yml
View file @
34dbe4e4
...
@@ -7,6 +7,8 @@ variables:
...
@@ -7,6 +7,8 @@ variables:
CONTENT
:
${CI_COMMIT_TITLE// /-}
CONTENT
:
${CI_COMMIT_TITLE// /-}
VIEW_URL
:
"
https://beta.laihua.com"
VIEW_URL
:
"
https://beta.laihua.com"
PIPELINES_URL
:
"
https://gitlab.laihua.com/qinmingyuan/translation-server/pipelines"
PIPELINES_URL
:
"
https://gitlab.laihua.com/qinmingyuan/translation-server/pipelines"
RANCHER_ACCESS_KEY
:
"
token-vhjc8"
RANCHER_SECRET_KEY
:
"
x2x4lffw58mxn9pxvsc6ckbxztj25mx4vvf74c6g6dqdbqsbqfzj9w"
# 定义阶段的执行顺序 分为 3个阶段
# 定义阶段的执行顺序 分为 3个阶段
stages
:
stages
:
...
@@ -49,7 +51,12 @@ deploy_job:
...
@@ -49,7 +51,12 @@ deploy_job:
only
:
only
:
-
dev
-
dev
script
:
script
:
-
echo "请在rancher中部署..."
-
echo "开始Rancher部署..."
# 根据返回的结果判断是否部署成功
-
response=$(curl -s -o /dev/null -w "%{http_code}" -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
"https://rancher.laihua.com/v3/project/local:p-b6lgm/workloads/deployment:test-domestic:translation-server?action=redeploy")
-
if [ "$response" -eq 200 ]; then echo "Rancher部署成功!"; else echo "Rancher部署失败!"; exit 1; fi
dependencies
:
dependencies
:
-
docker_job
-
docker_job
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment