• 欢迎访问蜷缩的蜗牛博客 蜷缩的蜗牛
  • 微信搜索: 蜷缩的蜗牛 | 联系站长 kbsonlong@qq.com
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Jenkins安装简要说明

Jenkins 蜷缩的蜗牛 2年前 (2017-02-19) 239次浏览 已收录 0个评论

1、配置Java环境变量

# mkdir /usr/local/java/ –p  
# cd /usr/local/java/  
# tar zxvf /data/elk5.0/jdk-8u111-linux-x64.tar.gz  
   
# cat >>/etc/profile<<EOF  
   
export JAVA_HOME=/usr/local/java/jdk1.8.0_111  
export PATH=$PATH:$JAVA_HOME/bin  
exportCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar  
EOF  
   
# source /etc/profile  
# java -version  
java version "1.8.0_111"  
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)  
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixedmode)

2、下载 jenkins.jar 包,https://jenkins.io/index.html

image

3、配置 JENKINS_HOME,如果不配置 JENKINS_HOME,默认 JENKINS_HOME 为用户家目录

# echo "export JENKINS_HOME=/data/PRG/jenkins" >>/etc/profile
# source /etc/profile
# echo $JENKINS_HOME
/data/PRG/jenkins

4、启动 jenkins

java -jar jenkins.war --httpPort=9000

–httpPort=9000  指定启动端口,默认为 8080 ;启动完成如下图所示

image

5、访问http://ip:9000 登录 jenkins

image

image

image

这些插件都需要联网下载安装,如果无法联网,可以找一台联网机器下载好*.jpi,然后上传到 JENKINS_HOME 目录下的 plugins 目录

jenkins 插件下载地址https://plugins.jenkins.io/ http://updates.jenkins-ci.org/download/plugins/

image

image

安装完成后,提示是否新建用户,如果不想新建用户直接点击 Continue as admin

image

image

image

下面摘自 jenkins 官网

RedHat Linux RPM packages for Jenkins

To use this repository, run the following command:

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

If you’ve previously imported the key from Jenkins, the “rpm –import” will fail because you already have a key. Please ignore that and move on.

With that set up, the Jenkins package can be installed with:

yum install jenkins

See Wiki for more information, including how Jenkins is run and where the configuration is stored, etc.

遇到问题:

1、在配置 salt api 的时候有个问题: 当 saltapi 配置 https 认证后,使用 curl 可以认证通过,但是在 jenkins 上配置上 https 后测试连接无法认证,提示:

Client error: Auth Error: net.sf.json.JSONException: JSONObject[“return”] is not a JSONArray.
{“Error”: “javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present

image

image

image

curl -sSk https://192.168.62.200:8000/login      -H 'Accept: application/json'      -d username=kbson      -d password=kbson      -d eauth=pam
{"return": [{"perms": [".*", "@wheel", "@runner"], "start": 1487137658.205297, "token": "3f04e0a8918f309ee8364eacd5bd3c239d77b86f", "expire": 1487180858.2052979, "user": "kbson", "eauth": "pam"}]}

蜷缩的蜗牛 , 版权所有丨如未注明 , 均为原创丨 转载请注明Jenkins 安装简要说明
喜欢 (2)
[]
分享 (0)

您必须 登录 才能发表评论!