美文网首页
Jenkins Gitlab持续集成

Jenkins Gitlab持续集成

作者: 王哈哈就很棒 | 来源:发表于2020-06-01 17:05 被阅读0次

gitlab安装&汉化

安装依赖

yum install -y curl policycoreutils-python openssh-server postfix

开启邮件服务

systemctl enable postfix
systemctl start postfix

从清华大学开源站下载gitlabrpm包,走官网下载很慢

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.2.8-ce.0.el7.x86_64.rpm

安装gitlab rpm

yum localinstall gitlab-ce-12.2.8-ce.0.el7.x86_64.rpm -y

修改请求页面URL
vim /etc/gitlab/gitlab.rb

修改 external_url

重载配置&启动

gitlab-ctl reconfigure
gitlab-ctl start

汉化包下载地址 https://gitlab.com/xhang/gitlab

wget https://gitlab.com/xhang/gitlab/-/archive/12-2-stable-zh/gitlab-12-2-stable-zh.tar.gz

停止gitlab

gitlab-ctl stop

解压, 替换

tar -xvf gitlab-12-2-stable.tar.gz
cd gitlab-12-2-stable
\cp -rf ./* /opt/gitlab/embedded/service/gitlab-rails/ 

忽略如下错误

cp: cannot overwrite non-directory ‘/opt/gitlab/embedded/service/gitlab-rails/log’ with directory ‘./log’
cp: cannot overwrite non-directory ‘/opt/gitlab/embedded/service/gitlab-rails/tmp’ with directory ‘./tmp’

重载配置&启动

gitlab-ctl reconfigure
gitlab-ctl start 

jenkins安装配置

下载jenkins源&导入密钥

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

本地传入jenkinsrpm

安装jenkins软件包

yum localinstall jenkins-2.222.4-1.1.noarch.rpm -y

安装java

# 更换源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

# 生成缓存
yum makecache
yum list java*
yum install java-1.8.0-openjdk.x86_64 -y

启动jenkins

systemctl start jenkins

访问

http://你的IP:8080

修改为国内源下载插件会很快

# 编辑 /var/lib/jenkins/updates/default.json
cd /var/lib/jenkins/updates

# 替换源地址
sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json && sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json

相关文章

网友评论

      本文标题:Jenkins Gitlab持续集成

      本文链接:https://www.haomeiwen.com/subject/zfuszhtx.html