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
You need to sign in or sign up before continuing.
Commit
34dbe4e4
authored
Jan 11, 2025
by
mingyard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:git ci rancher 自动部署
parent
6c09e710
Hide 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:
CONTENT
:
${CI_COMMIT_TITLE// /-}
VIEW_URL
:
"
https://beta.laihua.com"
PIPELINES_URL
:
"
https://gitlab.laihua.com/qinmingyuan/translation-server/pipelines"
RANCHER_ACCESS_KEY
:
"
token-vhjc8"
RANCHER_SECRET_KEY
:
"
x2x4lffw58mxn9pxvsc6ckbxztj25mx4vvf74c6g6dqdbqsbqfzj9w"
# 定义阶段的执行顺序 分为 3个阶段
stages
:
...
...
@@ -49,7 +51,12 @@ deploy_job:
only
:
-
dev
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
:
-
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