莫问 发表于 2018-9-3 11:16:03

jenkins+gitlab 快速部署

1,jenkins 部署
  

yum install -y java-1.8.0  
cd /etc/yum.repos.d/
  
wget http://pkg.jenkins.io/redhat/jenkins.repo
  
rpm --import http://pkg.jenkins.io/redhat/jenkins.io.key
  
yum install -y jenkins
  
systemctl start jenkins
  

  Jenkins Web访问地址:$IP:8080
  查看初始秘钥
  

# cat /var/lib/jenkins/secrets/initialAdminPassword  
490a2f35a2df49b6b8787ecb27122a3a
  

  然后就直接点一步,补全信息就可以了


2,gitlab
  下载epel源
  

# wget http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm  
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  
关闭 NetworkManager 和防火墙
  
#systemctl stop firewalld.service
  
systemctl disable firewalld
  
systemctl disable NetworkManager
  
关闭SELinux并确认处于关闭状态
  
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  
grep SELINUX=disabled /etc/selinux/config
  
setenforce 0
  
更新系统并重启
  
# yum update -y && reboot
  

# yum install curl policycoreutils openssh-server openssh-clients postfix -y  
# systemctl start postfix
  
# curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
  
# yum install -y gitlab-ce
  

  在安装一个git客户端
  

#yum install -y git  

  配置并启动gitlab-ce
  

# gitlab-ctl reconfigure  
#时间可能比较长,耐心你等待即可!----
  
###提示:修改完需要使用reconfigure重载配置才会生效
  

  gitlab常用命令:
  关闭gitlab:# gitlab-ctl stop
  启动gitlab:# gitlab-ctl start
  重启gitlab:# gitlab-ctl restart
  可以使用gitlab-ctl管理gitlab,例如查看gitlab状态:
  

#gitlab-ctl status  

  ###提示: 我们要保证80端口不被占用
  

# lsof -i:80  

  浏览器验证:
  

Web:访问:$IP  


  提示:启动gitlab需要时间!
  Web页面提示我们需要设置一个账号密码(我们要设置最少8位数的一个账号密码)我们设置密码为:q1w2e3r4
  

默认用户名:root   密码:q1w2e3r4 [刚才设置的]

页: [1]
查看完整版本: jenkins+gitlab 快速部署