清华大学开源镜像站之Jenkins下载
Java环境部署
因为我们的机器是64位,所以这里我们选择安装java-1.8.0-openjdk-devel.x86_64,在安装的时候注意,要选择带-devel的安装,因为这个安装的是jdk,而那个不带-devel的安装完了是jre。
[root@localhost ~]# yum search jdk [root@localhost ~]# yum -y install java-1.8.0-openjdk-devel.x86_64 [root@localhost ~]# java -version openjdk version "1.8.0_272" OpenJDK Runtime Environment (build 1.8.0_272-b10) OpenJDK 64-Bit Server VM (build 25.272-b10, mixed mode)
Jenkins下载
[root@localhost ~]# wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.249.3-1.1.noarch.rpm
Jenkins部署
[root@localhost ~]# rpm -qa | grep jenkins [root@localhost ~]# rpm -ivh jenkins-2.249.3-1.1.noarch.rpm
[root@localhost ~]# vim /etc/sysconfig/jenkins //Jenkins默认配置文件 ...... 27 # permissions of $JENKINS_HOME and /var/log/jenkins. 28 # 29 JENKINS_USER="root" ----》 //修改jenkins默认启动用户为root
[root@localhost ~]# systemctl start jenkins //启动Jenkins [root@localhost ~]# ps -aux | grep jenkins root 3138 93.8 16.5 3099400 336532 ? Ssl 20:06 0:06 /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 3224 0.0 0.0 112720 984 pts/0 S+ 20:06 0:00 grep --color=auto jenkins [root@localhost ~]# ss -antulp | grep :8080 tcp LISTEN 0 50 :::8080 :::* users:(("java",pid=11478,fd=161))
访问Jenkins
[root@localhost ~]# systemctl stop firewalld //关闭防火墙
浏览器访问输入Jekins机器IP地址与默认端口8080
root@localhost ~]# cat /var/lib/jenkins/secrets/initialAdminPassword 40761cdc468d41a6b1dacc0cd477e70a
这里暂时不按照任何插件,后面再安装
修改Jenkins镜像源
修改为清华大学Jenkins镜像源(https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/)
选择所需的插件安装