GitLab是一款不错的分布式版本控制系统
GitLab是一个利用RubyonRails开发的开源应用程序,实现自托管的Git项目仓库。...
GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。
它拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。
GitLab是一款不错的分布式版本控制系统,可以结合.gitlab-ci.yml文件用于版本发布的流程中,下面来讲下Centos7下安装Gitlab和gitlab-ci-multi-runner
首先访问
英文:https://about.gitlab.com/downloads/#centos7
中文:https://www.gitlab.cc/downloads/#centos7
Gitlab安装步骤:
1. 安装配置依赖项
如想使用Postfix来发送邮件,在安装期间请选择'Internet Site'. 您也可以用sendmai或者 配置SMTP服务 并 使用SMTP发送邮件.
在 Centos 6 和 7 系统上, 下面的命令将在系统防火墙里面开放HTTP和SSH端口.
sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
2. 添加GitLab仓库,并安装到服务器上
curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce
如果你不习惯使用命令管道的安装方式, 你可以在这里下载 安装脚本或者 手动下载您使用的系统相应的安装包(RPM/Deb)然后安装。
curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-XXX.rpm
rpm -i gitlab-ce-XXX.rpm
3. 启动GitLab
sudo gitlab-ctl reconfigure
停止命令 gitlab-ctl stop
启动命令 gitlab-ctl start查看日志 gitlab-ctl tail
查看状态 gitlab-ctl status
系统信息监测
# gitlab-rake gitlab:env:info
各种状态监测
# gitlab-rake gitlab:check
# gitlab-ctl reconfigure 使配置文件生效 但是会初始化除了gitlab.rb之外的所有文件
# gitlab-ctl show-config 验证配置文件
# gitlab-ctl restart 重启gitlab服务
# gitlab-ctl stop unicorn 停止组件内某一个服务
# gitlab-ctl status unicorn 查看状态
# gitlab-ctl kill unicorn kill掉某一个服务
# gitlab-ctl status unicorn 再次查看状态
# gitlab-ctl start unicorn 启动服务
4. 使用浏览器访问GitLab
首次访问GitLab,系统会让你重新设置管理员的密码,设置成功后会返回登录界面.
用户名/密码:root/5iveL!fe
默认的管理员账号是root,如果你想更改默认管理员账号,请输入上面设置的新密码登录系统后修改帐号名.
gitlab-ci-multi-runner安装访问
https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/linux-repository.md
gitlab-ci-multi-runner安装步骤:
1.执行如下命令
curl -L https://packages.gitlab.com/inst ... unner/script.rpm.sh | sudo bash
sudo yum install gitlab-ci-multi-runner
或者单独下载rpm包安装
wget https://mirror.tuna.tsinghua.edu.cn/gitlab-ci-multi-runner/yum/el7/gitlab-ci-multi-runner-1.1.4-1.x86_64.rpm
rpm -ivh gitlab-ci-multi-runner-1.1.4-1.x86_64.rpm
注册runner:
sudo gitlab-ci-multi-runner register
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/ci )
https://gitlab.com/ci
Please enter the gitlab-ci token for this runner
xxx
Please enter the gitlab-ci description for this runner
my-runner
INFO[0034] fcf5c619 Registering runner... succeeded
Please enter the executor: shell, docker, docker-ssh, ssh?
shell
INFO[0037] Runner registered successfully. Feel free to start it, but if it's
running already the config should be automatically reloaded!
gitlab-runner停止命令gitlab-runner stop
gitlab-runner启动命令gitlab-runner start
gitlab-runner状态命令gitlab-runner status
查找gitlab-ci-multi-runner进程
ps aux |grep gitlab-ci
root 4213 0.2 0.0 35768 5984 ? Ssl 10:33 0:00 /usr/bin/gitlab-ci-multi-runner
Gitlab的备份恢复和数据迁移
http://www.aqzt.com/thread-143-1-1.html
Gitlab恢复数据出现must be owner of解决方法
http://www.aqzt.com/thread-144-1-1.html
关注 安全专题
微信扫一扫关注公众号