Linux 安装Jenkins
1、首先准备java环境,安装JDK,当前新版jenkins要求jdk版本1.8.
2、下载jenkins至Linux服务器
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
|
3、配置jenkins端口
vi /etc/sysconfig/jenkins
查找/JENKINS_PORT,修改JENKINS_PORT="8080",默认为“8080”,我修改为了8088
|
4、启动jenkins
输入service jenkins restart
[root@bogon jenkins]# sudo service jenkins start Starting Jenkins bash: /usr/bin/java: No such file or directory [FAILED] |
5、配置jenkins配置文件
需要“vi /etc/init.d/jenkins”,把java路径加上,如下:----红色部分是我自己JDK路径
# 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=" |
配置后重新启动jenkins 启动成功!