Commit 7b14e1fb authored by 金凯强's avatar 金凯强 🎨

docker内部安装gitlab-runner 不用sudo命令

parent 72ac6b17
......@@ -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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment