gitlab 常用操作

1.gitlab 启动脚本

gitlab-runsvdir.service

2.gitlab 常用操作

gitlab start
gitlab-ctl stop
gitlab-ctl restart
#重新加载配置
gitlab-ctl reconfigure 

3. 仓库存储目录及数据迁移

默认的仓库存储路径在 /var/opt/gitlab/git-data

自定义git 仓库的存储路径并使其生效
git_date_dirs({
    "default" =>{
        "path" => "/data/gitlab/git-data"
    }
})

gitlab-ctl stop (数据迁移前,停止服务,防止用户写入数据)

rsync -av /var/opt/gitlab/git-data/repositories /data/gitlab/git-data/ (执行仓库数据迁移,正常情况应该有下面这个子目录)
gitlab-ctl reconfigure ( 使其配置生效)
gitlab-ctl start(开启服务,验证一下是否能通过web访问)

 

gitlab runner

gitlab runner注册

非交互注册

#示例1
#gitlab如果使用ssl证书的话要加上 --tls-ca-file
sudo gitlab-runner register \ --non-interactive \ --url "https://gitlab.com/" \ --tls-ca-file=/etc/gitlab/ssl/gitlab.example.com.crt \ --registration-token "获取的 token " \ --executor "docker" \ --docker-image alpine:latest \ --description "runner" \ --tag-list "docker,aws" \ --run-untagged \ --name my-runner --locked="false" \ # 示例2 gitlab-runner register --name my-runner \ --url http://gitlab.example.com \ --registration-token "6HkNBVenPd9sMyd2HzhK" \ --executor "shell" \ --tag-list "xmc_pro" \ --description "runner" \

gitlab-runner 验证

gitlab-runner verify

gitlab-runner 列表

gitlab-runner list

 

posted @ 2019-08-14 11:08  xmc_2022  阅读(167)  评论(0)    收藏  举报