一、安裝GitLab
1.1 配置gitlab的yum源
# 參考:https://packages.gitlab.com/gitlab/gitlab-ce/install#bash-rpm
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh|bash
yum install -y gitlab-ce
1.2 啓動GitLab與管理
gitlab-ctl reconfigure
gitlab-ctl start
gitlab-ctl status
gitlab-ctl stop
gitlab-ctl restart
ps -aux|grep runsvdir
二、安裝JDK
yum install -y java-1.8.0-openjdk
三、安裝Jenkins
3.1 配置Jenkins的yum源
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
3.2 安裝Jenkins
yum install -y jenkins
3.3 啓動jenkins
systemctl start jenkins
systemctl enable jenkins
systemctl status jenkins
3.4 修改Jenkins配置文件
3.4.1 修改Jenkins運行用戶
vim /etc/sysconfig/jenkins
# 修改$JENKINS_USER,並去掉當前行的註釋
$JENKINS_USER='work'
3.4.2 修改Jenkins相關文件夾用戶權限
chown -R work:work /var/lib/jenkins
chown -R work:work /var/cache/jenkins
chown -R work:work /var/log/jenkins
3.4.3 重啓Jenkins服務並檢查運行Jenkins的用戶是否已經切換爲work
systemctl restart jenkins
ps -ef|grep jenkins
3.5 Jenkins插件推薦
1.Git Parameter # 構建參數
2.build-name-setter # ${BUILD_NUMBER}-$moudle-$release_tag
3.user build vars plugin # 獲取運行job的用戶名
4.Jenkins修改本地默認主題
主題URL:http://afonsof.com/jenkins-material-theme/
1) Jenkins安裝 Simple Theme插件
2) 瀏覽器下載stylish css導入服務器。放到 /var/cache/jenkins/war/css
3) 而後在Jenkins的系統配置中添加Theme配置 http://10.0.0.100:8080/css/jenkins-material-theme.css
3.6 Ansible安裝
yum install -y ansible