1. 官网2.7jenkins.war下载 http://mirrors.jenkins.io/war-stable/2.73.2/jenkins.war
jdk-x86 linux 32bit适用 https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-i586.rpm
jdk-x64 linux 64bit适用https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.rpm
tomcat8 安装 :http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.38/bin/apache-tomcat-8.5.38.tar.gz
cd /usr/local
mkdir tomcat8
cd tomcat8
以上jdk 包根据liunx位数
安装jdk我是32bit linux
rpm -ivh jdk-8uxxxxxxxx.rpm
wget http://mirrors.jenkins.io/war-stable/2.73.2/jenkins.war
wget https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-i586.rpm
wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.38/bin/apache-tomcat-8.5.38.tar.gz
cd /usr/local
tar xvf apachhe-tomcatxxx.tar.gz
cp -r jenkins.war /apache-tomcat-8.5.38/webapps/
service iptables status 检查防火墙状态
修改防火墙 vi /etc/sysconfig/iptables添加
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 j ACCEPT
保存退出
重启防火墙
service iptables restart
或者
执行linux 命令 添加端口
#开启80端口
/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
#保存配置
/etc/rc.d/init.d/iptables save
#重启服务
/etc/rc.d/init.d/iptables restart
开启tomcat
/usr/local/apache-tomcat-8.5.38/bin/startup.sh
ps -ef |grep tomcat
检查tomcat进程状态
ifconfig 查看服务器jenkins地址
eth0 Link encap:Ethernet HWaddr 00:0C:29:F4:A4:5A
inet addr:192.168.229.128 Bcast:192.168.229.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fef4:a45a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:164386 errors:0 dropped:0 overruns:0 frame:0
TX packets:103125 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:187379614 (178.6 MiB) TX bytes:51262674 (48.8 MiB)
Interrupt:19 Base address:0x2024
默认80端口:http://192.168.229.128:8080/jenkins/
2.jenkins 密码获取
cat /var/lib/jenkins/secrets/initialAdminPassword
admin/密码
jenkins新建配置
系统管理》配置全局安全性
whereis git
若无使用yum安装git
yum install -y git
解决git此处爆红
进入系统管理》》管理节点 》》新建节点
先配置git server 添加密码账户,这里用github做演示
java maven构建推荐文章:https://blog.csdn.net/qq_32445069/article/details/78924534