1.sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo
2.sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.keyhtml
3.yum install jenkinsjava
自動安裝完成以後: jvm
/usr/lib/jenkins/jenkins.war WAR包 ui
/etc/sysconfig/jenkins 配置文件this
/var/lib/jenkins/ 默認的JENKINS_HOME目錄日誌
/var/log/jenkins/jenkins.log Jenkins日誌文件code
4.須要「vi /etc/init.d/jenkins」,把java路徑加上,以下:htm
# Search usable Java. We do this because various reports indicated # that /usr/bin/java may not always point to Java >= 1.6 # see http://www.nabble.com/guinea-pigs-wanted-----Hudson-RPM-for-RedHat-Linux-td25673707.html candidates=" /etc/alternatives/java /usr/lib/jvm/java-1.6.0/bin/java /usr/lib/jvm/jre-1.6.0/bin/java /usr/lib/jvm/java-1.7.0/bin/java /usr/lib/jvm/jre-1.7.0/bin/java /usr/lib/jvm/java-1.8.0/bin/java /usr/lib/jvm/jre-1.8.0/bin/java /usr/bin/java /usr/java/jdk1.7.0_79/bin/java " for candidate in $candidates do [ -x "$JENKINS_JAVA_CMD" ] && break JENKINS_JAVA_CMD="$candidate" done JAVA_CMD="$JENKINS_JAVA_CMD $JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR"
5.啓動:service jenkins startget