jenkins安装与使用

本例演示使用jenkins.war包直接部署,版本为2.7.2,可以网址https://jenkins.io/index.html查看。

步骤一、

下载jenkins包(jenkins.war包)

重新配置下jenkins工作目录 /project/jenkins_space

vi /etc/profile
文件尾部添加 
export JENKINS_HOME=/project/jenkins_space

source /etc/profile
使配置立即生效

步骤二、

安装好tomcat,将jenkins.war放到tomcat的webapps中,启动tomcat即可,若出现类似以下警告, 则直接修改hosts文件(vi /etc/hosts),将原127.0.0.1替换成127.0.0.1 localhost centos-a即可

警告: Could not intialize the host network interface on nullbecause of an error: centos-a: centos-a: 未知的名称或服务
java.net.UnknownHostException: centos-a: centos-a: 未知的名称或服务

正常启动时提示密码;当然也可直接 cat /project/jenkins_space/secrets/initialAdminPassword 查看密码

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

836c01ba144248d2a7a855adf936587b

This may also be found at: /project/jenkins_space/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

步骤三、

使用提示的密码登入(默认用户名admin),初次打开会提示安装插件,关闭提示小窗口即可,打开Jenkins->系统管理,若有以下提示,需要配置tomcat支持utf-8,在Connector标签中添加属性URIEncoding=”UTF-8”重启即可

Your container doesn't use UTF-8 to decode URLs. If you use non-ASCII characters as a job name etc, this will cause problems. See Containers and Tomcat i18n for more details.

步骤四、

正常启动tomcat后,使用浏览器访问jenkins,会要求输入用户名(admin)及密码(后台启动提示的密码),按提示操作。

结束。


赞赏(Donation)
微信(Wechat Pay)

donation-wechatpay