Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
install.api
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
install.api
Commits
7b14e1fb
Commit
7b14e1fb
authored
Mar 12, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docker内部安装gitlab-runner 不用sudo命令
parent
72ac6b17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
install_service.py
app/install/install_service.py
+3
-3
No files found.
app/install/install_service.py
View file @
7b14e1fb
...
...
@@ -29,7 +29,7 @@ class InstallService(HSBaseUCService):
:return:
'''
self
.
delete_setting_file
()
s1
=
os
.
system
(
"
sudo
docker run --rm -t -i -v /etc/gitlab-runner:/etc/gitlab-runner gitlab/gitlab-runner register
\
s1
=
os
.
system
(
"docker run --rm -t -i -v /etc/gitlab-runner:/etc/gitlab-runner gitlab/gitlab-runner register
\
-n -u http://47.110.145.204:8085/ -r WwpzH4qk19KjvAjEwoTz --executor docker --docker-image docker
\
--description huansi.{hscode}
\
--tag-list huansi.{hscode}"
.
format
(
hscode
=
HSCUSCODE
))
...
...
@@ -52,10 +52,10 @@ class InstallService(HSBaseUCService):
移除旧runner容器,主要作用于第二次第三次的重复安装
:return:
'''
os
.
system
(
"
sudo
docker stop gitlab-runner && docker rm gitlab-runner"
)
os
.
system
(
"docker stop gitlab-runner && docker rm gitlab-runner"
)
def
start_runner
(
self
):
s
=
os
.
system
(
"
sudo
docker run -d --name gitlab-runner --restart always
\
s
=
os
.
system
(
"docker run -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
\
...
...
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