jenkins安装配置管理(旧)
jenkins安装配置管理
1.安装依赖
yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
java -version
2.添加yum仓库源
下载yum仓库源配置文件
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
导入仓库key
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
3.关闭防火墙和selinux
4.安装与初始化配置
yum install jenkins # 安装最新版
useradd -s /sbin/nologin deploy # 创建jenkins用户
vim /etc/sysconfig/jenkins # 更改启动用户与端口
...
JENKINS_USER=deploy
JENKINS_PORT=8080
...
chown -R deploy:deploy /var/lib/jenkins # 修改jenkins家目录所有者、所有组
chown -R deploy:deploy /var/log/jenkins # 修改jinkins日志目录所有者、所有组
chown -R deploy:deploy /var/cache/jenkins/
systemctl start jenkins # 启动jenkins
5.访问
ip:8080 # 浏览器访问
/var/lib/jenkins/secrets/initialAdminPassword # 粘贴密码
选择右下角的 admin继续
jenkins安装目录:/var/lib/jenkins
jenkins日志目录:/var/log/jenkins/jenkins.log
jenkins默认配置:/etc/default/jenkins
安装git
装依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install gcc perl-ExtUtils-MakeMaker
移除已有git
yum remove git
解压安装
cd /usr/src/
tar zxf git-2.27.0.tgz
cd git-2.27.0
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc
检查版本号
git--version
配置
系统管理-全局安全配置
允许用户注册
Anyone cao do anything(仅在学习时勾选,生产环境一般不勾选)
标签:git,deploy,配置管理,devel,yum,var,jenkins,安装
From: https://www.cnblogs.com/lixunblogs/p/18167135