Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
deploy
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
Script
deploy
Commits
063cad25
Commit
063cad25
authored
Feb 24, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
镜像打包前,删除旧镜像
parent
84f46aab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
install_runner.py
install_runner.py
+5
-1
No files found.
install_runner.py
View file @
063cad25
...
...
@@ -28,7 +28,10 @@ def install_runner(HSCUSCODE=None):
with
open
(
'/etc/gitlab-runner/config.toml'
,
'w'
)
as
f
:
f
.
write
(
a
)
s2
=
os
.
system
(
"sudo docker run -d --name gitlab-runner --restart always
\
s1
=
os
.
system
(
"sudo docker stop gitlab-runner and docker rm gitlab-runner"
)
assert
s1
==
0
,
"移除gitlab-runner失败"
s2
=
os
.
system
(
"sudo docker run --rm -d --name gitlab-runner --restart always
\
-v /etc/gitlab-runner:/etc/gitlab-runner
\
-v /var/run/docker.sock:/var/run/docker.sock
\
-v /etc/profile.d/huansi.sh:/etc/profile.d/huansi.sh
\
...
...
@@ -54,6 +57,7 @@ def register_huansi_runner(HSCUSCODE):
--tag-list huansi.{hscode}"
.
format
(
hscode
=
HSCUSCODE
))
assert
s1
==
0
,
"huansi_runner配置失败,如果要重新执行,不要再次执行init.py文件,请直接执行install_docker.py文件"
if
__name__
==
'__main__'
:
if
os
.
path
.
exists
(
'/etc/gitlab-runner'
):
install_runner
()
...
...
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