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
676df456
Commit
676df456
authored
Feb 26, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
脚本修复
parent
608c975e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
13 deletions
+2
-13
install_runner.py
install_runner.py
+2
-13
No files found.
install_runner.py
View file @
676df456
...
@@ -7,18 +7,9 @@ def install_runner(HSCUSCODE=None):
...
@@ -7,18 +7,9 @@ def install_runner(HSCUSCODE=None):
if
not
HSCUSCODE
:
if
not
HSCUSCODE
:
HSCUSCODE
=
input
(
"请输入客户代号HSCUSCODE:"
)
HSCUSCODE
=
input
(
"请输入客户代号HSCUSCODE:"
)
print
(
HSCUSCODE
)
print
(
HSCUSCODE
)
if
os
.
path
.
exists
(
'/etc/gitlab-runner/config.toml'
):
with
open
(
'/etc/gitlab-runner/config.toml'
,
'r'
)
as
f
:
content
=
f
.
read
()
if
'huansi.{hscode}'
.
format
(
hscode
=
HSCUSCODE
)
not
in
content
:
register_huansi_runner
(
HSCUSCODE
)
# if 'gitlab.{hscode}'.format(hscode=HSCUSCODE) not in content:
os
.
system
(
"rm /etc/gitlab-runner/config.toml -f && sudo docker stop gitlab-runner && docker rm gitlab-runner"
)
# register_gitlab_runner(HSCUSCODE)
register_huansi_runner
(
HSCUSCODE
)
else
:
register_huansi_runner
(
HSCUSCODE
)
# register_gitlab_runner(HSCUSCODE)
os
.
system
(
"sudo chmod 777 /etc/gitlab-runner/config.toml"
)
os
.
system
(
"sudo chmod 777 /etc/gitlab-runner/config.toml"
)
with
open
(
'/etc/gitlab-runner/config.toml'
,
'r'
)
as
f
:
with
open
(
'/etc/gitlab-runner/config.toml'
,
'r'
)
as
f
:
...
@@ -28,8 +19,6 @@ def install_runner(HSCUSCODE=None):
...
@@ -28,8 +19,6 @@ def install_runner(HSCUSCODE=None):
with
open
(
'/etc/gitlab-runner/config.toml'
,
'w'
)
as
f
:
with
open
(
'/etc/gitlab-runner/config.toml'
,
'w'
)
as
f
:
f
.
write
(
a
)
f
.
write
(
a
)
os
.
system
(
"sudo docker stop gitlab-runner && docker rm gitlab-runner"
)
s2
=
os
.
system
(
"sudo docker run -d --name gitlab-runner --restart always
\
s2
=
os
.
system
(
"sudo docker run -d --name gitlab-runner --restart always
\
-v /etc/gitlab-runner:/etc/gitlab-runner
\
-v /etc/gitlab-runner:/etc/gitlab-runner
\
-v /var/run/docker.sock:/var/run/docker.sock
\
-v /var/run/docker.sock:/var/run/docker.sock
\
...
...
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