Omnibus Gitlab + Runner 配置
2016-05-20 14:02
453 查看
本文以最小化安装为前题 (最快速安装/最少行指令/1台服务器)
安装需要的dependencies(postfix是发送邮件的程序,Gitlab需要发送邮件来验证注册用户的邮箱是否合法,我使用第三方SMTP服务器进行发送,你可以自行决定是否要使用postfix)
增加gitlab source并且安装
安装完成之后运行gitlab设置程序
设置完成之后浏览到http://localhost,设置初始密码并登入,预设管理员帐号是 root
*若在国内因为伟大的GFW而无法安装Gitlab,查看这篇文章的作法https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/
将runner添加到安装source里(自行选择对应的系统)
安装runner
执行runner configuration
参考如下回答
最后确保docker有在运行
安装Gitlab CE
前往https://about.gitlab.com/downloads/,并选择自己的操作系统,我自己使用的是CentOS 6,如果不是CentOS的话按照官网上的英文教程操作即可,以下代码摘取自CentOS6的安装教程。安装需要的dependencies(postfix是发送邮件的程序,Gitlab需要发送邮件来验证注册用户的邮箱是否合法,我使用第三方SMTP服务器进行发送,你可以自行决定是否要使用postfix)
sudo yum install curl openssh-server openssh-clients postfix cronie sudo service postfix start sudo chkconfig postfix on sudo lokkit -s http -s ssh
增加gitlab source并且安装
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash sudo yum install gitlab-ce
安装完成之后运行gitlab设置程序
sudo gitlab-ctl reconfigure
设置完成之后浏览到http://localhost,设置初始密码并登入,预设管理员帐号是 root
*若在国内因为伟大的GFW而无法安装Gitlab,查看这篇文章的作法https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/
安装Gitlab Runner
先安装Docker (Docker是一种虚拟机,Runner在执行test的时候会以一台乾净的机器的形式执行测试)curl -sSL https://get.docker.com/ | sh
将runner添加到安装source里(自行选择对应的系统)
# For Debian/Ubuntu curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash # For CentOS curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | sudo bash
安装runner
# For Debian/Ubuntu sudo apt-get install gitlab-ci-multi-runner # For CentOS sudo yum install gitlab-ci-multi-runner
执行runner configuration
sudo gitlab-ci-multi-runner register
参考如下回答
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/ci ) 自己gitlab的域名,后面加/ci Please enter the gitlab-ci token for this runner 用管理员帐号登入自己的gitlab -> Admin Area -> Settings -> Runner -> 并且复制该页面的registration token到此 Please enter the gitlab-ci description for this runner 给这个runner一个名字,随便写,我给的是Local Shared Runner INFO[0034] fcf5c619 Registering runner... succeeded Please enter the executor: shell, docker, docker-ssh, ssh? docker Please enter the Docker image (eg. ruby:2.1): php5.6 INFO[0037] Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
最后确保docker有在运行
sudo service docker start
相关文章推荐
- centos6.5上安装docker
- Centos6 编译安装Python
- docker容器的网络信息查看
- 硬盘安装CentOS 6.2以及添加GRUB启动菜单
- CentOS 6.2实战部署Nginx+MySQL+PHP
- CentOS 7系统配置上的变化解析
- openstack kilo-with-dokcer
- CentOS下DB2数据库安装过程详解
- CentOS 6.3下编译安装Ruby 2.0笔记
- 在windows下的安装Docker的教程
- 8个你可能不知道的Docker知识
- 在Centos 5.5 上编译安装mysql 5.5.9
- 在阿里云的CentOS环境中安装配置MySQL的教程
- CentOS 6.5源码安装Erlang教程
- Centos下安装docker教程
- 在CenOS系统下安装和配置Redis数据库的教程
- centos 5.6 升级php到5.3的方法