一、Jenkins简介
Jenkins 是一个开源项目,提供了一种易于使用的持续集成系统,使开发者从繁杂的集成中解脱出来,专注于更为重要的业务逻辑实现上。同时 Jenkins 能实施监控集成中存在的错误,提供详细的日志文件和提醒功能,还能用图表的形式形象地展示项目构建的趋势和稳定性。
Jenkins可以做到持续编译和发布软件项目,这使得开发者很容易把他们的改动集成到项目中,还让用户能更加便利的获取编译和测试版本;
二、java环境下载安装
2.1 进入opt目录并下载jre
[[email protected] ~]# cd /opt [[email protected] opt]# wget -O jre-8u101-linux-x64.tar.gz " http://sdlc-esd.oracle.com/ESD6/JSCDL/jdk/8u101-b13/jre-8u101-linux-x64.tar.gz?GroupName=JSC&FilePath=/ESD6/JSCDL/jdk/8u101-b13/jre-8u101-linux-x64.tar.gz&BHost=javadl.sun.com&File=jre-8u101-linux-x64.tar.gz&AuthParam=1472441383_f4bf6efe030eac7fa583ef003168c2e6&ext=.gz"
2.2 解压jre 并进入jre文件安装
[[email protected] opt]# tar xvf jre-8u101-linux-x64.tar.gz [[email protected] opt]# ls /opt jre1.8.0_101 jre-8u101-linux-x64.tar.gz [[email protected] opt]#cd jre1.8.0_101 / [[email protected] jre1.8.0_101]#alternatives --install /usr/bin/java java /opt/jre1.8.0_101/bin/java 1 [[email protected] jre1.8.0_101]# alternatives --config java There is 1 program that provides ‘java‘. Selection Command ----------------------------------------------- *+ 1 /opt/jre1.8.0_101/bin/java Enter to keep the current selection[+], or type selection number: 1
三、安装jenkins
3.1下载并安装
[[email protected] opt]#wget http://mirrors.jenkins-ci.org/redhat-stable/jenkins-2.7.2-1.1.noarch.rpm [[email protected] opt]# rpm -ivh jenkins-2.7.2-1.1.noarch.rpm warning: jenkins-2.7.2-1.1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID d50582e6: NOKEY Preparing... ########################################### [100%] 1:jenkins ########################################### [100%]
[[email protected] ~]# chkconfig --list jenkins jenkins 0:off 1:off 2:off 3:on 4:off 5:on 6:off [[email protected] ~]# /etc/init.d/jenkins start Starting Jenkins [ OK ] [[email protected] ~]# ps -ef |grep jenkins jenkins 4275 1 99 11:41 ? 00:00:43 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20 root 4363 3666 0 11:42 pts/0 00:00:00 grep jenkins [[email protected] ~]# netstat -ntlup |grep java tcp 0 0 :::8080 :::* LISTEN 4275/java tcp 0 0 :::37589 :::* LISTEN 4275/java udp 0 0 :::5353 :::* 4275/java udp 0 0 :::33848 :::* 4275/java
3.2防火墙开放8080端口
[[email protected] ~]# iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
3.3WEB界面安装
打开浏览器输入http://ipaddress of server:8080进入WEB安装界面
复制/var/lib/jenkins/secrets/initialAdminPassword文件内容并粘贴
[[email protected] ~]# cat /var/lib/jenkins/secrets/initialAdminPassword 425e6a44319e4c8fb909a73b02d1b55c
选择安装jenkins插件
插件类型选择
插件安装
配置密码后登陆。
我们现在就可以访问Jenkins,链接地址:http://ipaddress of server:8080 or http://localhost:8080
安装完毕。
时间: 2024-10-07 04:59:17