Install gitlab-runner on centos7

网友投稿 365 2022-11-06


Install gitlab-runner on centos7

Gitlab CICD状态pending

显示并未有任何可用runner

添加官方repository

curl -L "| sudo bash

检查当前gitlab版本

[root@gitlab ~]# rpm -qa |grep gitlabgitlab-ee-12.9.2-ee.0.el7.x86_64

安装特定版本gitlab-runner

yum list gitlab-runner --showduplicates | sort -rsudo yum install gitlab-runner-12.9.1-1

注册到gitlab

获取相关信息

运行gitlab-runner register命令进行注册

[root@gitlab ~]# gitlab-runner registerRuntime platform arch=amd64 os=linux pid=12329 revisinotallow=97153df7 versinotallow=12.9.1Running in system-mode.# 输入gitlab的url地址Please enter the gitlab-ci coordinator URL (e.g. 输入注册的tokenPlease enter the gitlab-ci token for this runner:13o3h7ZEiUVXGJfZe5Cy# 输入对这个runner的描述,同时也是次runner的名字Please enter the gitlab-ci description for this runner:[gitlab.xxxxxx.com]: test_runner# 输入runner的tagPlease enter the gitlab-ci tags for this runner (comma separated):testRegistering runner... succeeded runner=K6cy5i3y# 输入runner的executorPlease enter the executor: docker+machine, docker-ssh+machine, shell, docker, docker-ssh, parallels, ssh, virtualbox, kubernetes, custom:docker# 这里选择docker,需要制定默认的docker image来运行job(可以在.gitlab-ci.yml里修改需要用的image)Please enter the default Docker image (e.g. ruby:2.6):docker:19.03.13Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

注册完成后,自动生成配置文件

[root@gitlab ~]# cat /etc/gitlab-runner/config.tomlconcurrent = 1check_interval = 0[session_server] session_timeout = 1800[[runners]] name = "maven" url = " token = "13o3h7ZEiUVXGJfZe5Cy" executor = "docker" [runners.custom_build_dir] [runners.cache] [runners.cache.s3] [runners.cache.gcs] [runners.docker] tls_verify = false image = "maven:latest" extra_hosts = ["gitlab.xxxxxx.com:172.19.201.230"] privileged = false disable_entrypoint_overwrite = false oom_kill_disable = false disable_cache = false volumes = ["/cache"] shm_size = 0

gitlab上也能看到此runner的信息

unregister runner

[root@gitlab ~]# gitlab-runner unregister --url --token 13o3h7ZEiUVXGJfZe5CyRuntime platform arch=amd64 os=linux pid=6978 revisinotallow=97153df7 versinotallow=12.9.1Running in system-mode.Unregistering runner from GitLab succeeded runner=K6cy5i3yUpdated /etc/gitlab-runner/config.toml


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Java实现石头剪刀布小游戏
下一篇:山东高速路况查询API(山东高速路况查询电话96199)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~