Jenkins自动化
一 环境搭建(Linux)
步骤 1 安装jdk yum install -y java-1.8.0
2 安装Jenkins
yum的repo中默认没有Jenkins,需要先将Jenkins存储库添加到yum repos ---- 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
yum install -y jenkins
3 启动Jenkins
service jenkins start
4 查看安装情况 rpm -ql jenkins
补充 ubuntu 安装
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
二任务部署
1 新建Jenkins主目录 mkdir -p /data/jenkins --> 修改权限 chown -R jenkins:jenkins /data/jenkins
2 修改配置文件 vim /etc/sysconfig/jenkins
JENKINS_HOME="/mnt/cellar/jenkins"
JENKINS_USER="jenkins"
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Xms256m -Xmx512m -XX:MaxNewSize=256m -XX:Maxize=256m"
JENKINS_PORT="8000"
3 重新启动Jenkins service jenkins start
三脚本执行
四插件扩展