gitlab--基础--4.2--CICD--runner--常用命令

gitlab–基础–4.2–CICD–runner–常用命令


1、systemctl

读取的配置是 /etc/systemd/system/gitlab-runner.service文件


# 启动
systemctl start gitlab-runner.service 
 
# 停止
systemctl stop gitlab-runner.service 

# 重启
systemctl restart gitlab-runner.service 

# 查看状态
systemctl status gitlab-runner.service 

在这里插入图片描述

2、gitlab-runner run

2.1、语法

USAGE:
   gitlab-runner run [command options] [arguments...]

OPTIONS:
   -c value, --config value             配置文件路径,.toml结尾
   --listen-address value               端口
   -n value, --service value            服务名称,默认是gitlab-runner
   -d value, --working-directory value  工作目录,也就是从gitlab clone项目的目录,默认是当前目录
   -u value, --user value               执行shell脚本所用的用户
   --syslog    

2.2、案例

使用/root/config.toml配置文件,root用户启动


sudo gitlab-runner run -c /root/config.toml -u root &

3、gitlab-runner

2.1、语法

[root@zhoufei ~]# gitlab-runner -help
NAME:
   gitlab-runner - a GitLab Runner

USAGE:
   gitlab-runner [global options] command [command options] [arguments...]

VERSION:
   15.2.1 (32fc1585)

AUTHOR:
   GitLab Inc. <support@gitlab.com>

COMMANDS:
     exec                  execute a build locally
     list                  列出了保存在配置文件中的所有运行 Runner
     run                   run multi runner service
     register              默认交互模式下使用,非交互模式添加 --non-interactive
     install               安装 gitlab-runner
     uninstall             卸载 gitlab-runner
     start                 启动 gitlab-runner
     stop                  停止 gitlab-runner
     restart               重启 gitlab-runner
     status                获取服务状态
     run-single            start single runner
     unregister            该命令使用GitLab取消已注册的runner。。
     verify                检查注册的runner是否可以连接,但不验证GitLab服务是否正在使用runner
     artifacts-downloader  download and extract build artifacts (internal)
     artifacts-uploader    create and upload build artifacts (internal)
     cache-archiver        create and upload cache artifacts (internal)
     cache-extractor       download and extract cache artifacts (internal)
     cache-init            changed permissions for cache paths (internal)
     health-check          check health for a specific address
     read-logs             reads job logs from a file, used by kubernetes executor (internal)
     help, h               Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --cpuprofile value           write cpu profile to file [$CPU_PROFILE]
   --debug                      debug mode [$RUNNER_DEBUG]
   --log-format value           Choose log format (options: runner, text, json) [$LOG_FORMAT]
   --log-level value, -l value  Log level (options: debug, info, warn, error, fatal, panic) [$LOG_LEVEL]
   --help, -h                   show help
   --version, -v                print the version

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值