系统环境:Ubuntu 17.04 \n \l


安装的jenkins版本:2.60.3


安装方式,从官网得知安装方式如下:

On Debian-based distributions, such as Ubuntu, you can install Jenkins through apt.

Recent versions are available in an apt repository. Older but stable LTS versions are in this apt repository.

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.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


所以,如果是ubutun的话,按照如上安装方式如下:

第一步:

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.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

安装过程有点慢,一旦安装完成后,jenkins就会自动启动,从jenkins日志文件中就可以看到:

jenkines日志文件的位置:/var/log/jenkins/jenkins.log

jenkines文件的安装位置:/var/lib/jenkins



如果想关闭jenkines,可以使用如下方式:

service jenkins stop

service jenkins start


或者:

sudo /etc/init.d/jenkins start

sudo /etc/init.d/jenkins stop



接下来进入jenkins的界面安装步骤:

在浏览器上面输入:http://10.200.80.49:8080(默认是8080端口)

初次登陆时候,会看到主界面如下:



需要输入密码才能continue,密码在/var/lib/jenkins/secret/initialAdminPassword文件中。



接下来安装plugins:



默认选择suggested plugins。




安装plugins的过程中(及时安装失败也没事)!




设置用户名密码,这是进入jenkines的权限,务必请记住!此时安装ok。



再次进入jenkines的主界面时候,输入用户名账号和密码呈现出如下界面则说明安装结束.













如何修改jenkines的端口:

If your /etc/init.d/jenkins file fails to start Jenkins, edit the /etc/default/jenkins to replace the line----HTTP_PORT=8080---- with ----HTTP_PORT=8081----Here, "8081" was chosen but you can put another port available.

jenkines官网中有如上一段说明:如果启动失败,在/etc/default/jenkins中奖HTTP_PORT=8080改为HTTP_PORT=8081,这个就是修改端口的方式,本人修改截图界面如下,例如改为8081:



Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐