在CentOS中安装jenkins

时间:2021-03-14 16:47:51

一、检查java是否安装

 $ java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.) (rhel-1.41.1.10..el6-x86_64)
OpenJDK -Bit Server VM (build 20.0-b11, mixed mode)

如果没有安装:yum install java-1.7.0-openjdk* -y

二、下载jenkins

 $ mkdir -p jenkins/jenkins_home
$ mkdir -p jenkins/jenkins_node
$ cd jenkins
$ wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war
$ tar -zvxf jenkins.war

三、启动jenkins

实现启动脚本:

 $ vim start_jenkins.sh
start_jenkins.sh
#!/bin/bash
JENKINS_ROOT=/home/AAA/jenkins
export JENKINS_HOME=$JENKINS_ROOT/jenkins_home
java -jar $JENKINS_ROOT/jenkins.war --httpPort=
$ chmod a+x start_jenkins.sh
$ nohup ./start_jenkins.sh > jenkins.log >& &

四、访问jenkins:

在浏览器中输入http://192.168.0.1:8000 进行Project配置等即可。