安装jdk
yum安装不需要配置环境变量
安装maven
下载maven
压缩包上传至服务器
解压缩
修改maven配置文件镜像地址
配置环境变量
安装Git
安装Jenkins
war包下载
安装运行Jenkins
安装jdk
【Linux】Linux8 安装 JDK(适用于各个版本)_写bug的程序鱼的博客-CSDN博客
yum安装不需要配置环境变量
yum search jdk # yum查看jdk版本
#yum install -y java-11-openjdk.x86_64
#yum install -y java-11-openjdk-devel.x86_64
#yum install -y java-11-openjdk-headless.x86_64 安装必要的(-y表示安装过程中都默认yes)
rpm -qa | grep jdk
copy-jdk-configs-3.3-10.el7_5.noarch
java-11-openjdk-headless-11.0.13.0.8-1.el7_9.x86_64
java-11-openjdk-11.0.13.0.8-1.el7_9.x86_64
java-11-openjdk-devel-11.0.13.0.8-1.el7_9.x86_64 查看是否安装成功
安装maven
下载maven
Maven – Download Apache Maven
压缩包上传至服务器
解压缩
tar -zxvf apache-maven-3.8.6-bin.tar.gz
修改maven配置文件镜像地址
cd apache-maven-3.8.6/conf
vim settings.xml
配置环境变量
export MAVEN_HOME=/root/apache-maven-3.8.6
安装Git
配置git地址时,jenkins会自动使用git命令,所以需要安装git
yum install git
Last metadata expiration check: 0:13:49 ago on Mon 21 Nov 2022 07:30:20 PM PST.
Dependencies resolved.
=============================================================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================================================
Installing:
git x86_64 2.27.0-1.el8 appstream 164 k
Installing dependencies:
git-core x86_64 2.27.0-1.el8 appstream 5.7 M
git-core-doc noarch 2.27.0-1.el8 appstream 2.5 M
perl-Error noarch 1:0.17025-2.el8 appstream 46 k
perl-Git noarch 2.27.0-1.el8 appstream 77 k
perl-TermReadKey x86_64 2.37-7.el8 appstream 40 k
Transaction Summary
=============================================================================================================================================================================================
Install 6 Packages
Total download size: 8.5 M
Installed size: 45 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): git-2.27.0-1.el8.x86_64.rpm 19 kB/s | 164 kB 00:08
(2/6): perl-Error-0.17025-2.el8.noarch.rpm 78 kB/s | 46 kB 00:00
(3/6): perl-Git-2.27.0-1.el8.noarch.rpm 103 kB/s | 77 kB 00:00
(4/6): perl-TermReadKey-2.37-7.el8.x86_64.rpm 54 kB/s | 40 kB 00:00
(5/6): git-core-doc-2.27.0-1.el8.noarch.rpm 169 kB/s | 2.5 MB 00:15
(6/6): git-core-2.27.0-1.el8.x86_64.rpm 296 kB/s | 5.7 MB 00:19
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 444 kB/s | 8.5 MB 00:19
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : git-core-2.27.0-1.el8.x86_64 1/6
Installing : git-core-doc-2.27.0-1.el8.noarch 2/6
Installing : perl-TermReadKey-2.37-7.el8.x86_64 3/6
Installing : perl-Error-1:0.17025-2.el8.noarch 4/6
Installing : perl-Git-2.27.0-1.el8.noarch 5/6
Installing : git-2.27.0-1.el8.x86_64 6/6
Running scriptlet: git-2.27.0-1.el8.x86_64 6/6
Verifying : git-2.27.0-1.el8.x86_64 1/6
Verifying : git-core-2.27.0-1.el8.x86_64 2/6
Verifying : git-core-doc-2.27.0-1.el8.noarch 3/6
Verifying : perl-Error-1:0.17025-2.el8.noarch 4/6
Verifying : perl-Git-2.27.0-1.el8.noarch 5/6
Verifying : perl-TermReadKey-2.37-7.el8.x86_64 6/6
Installed:
git-2.27.0-1.el8.x86_64 git-core-2.27.0-1.el8.x86_64 git-core-doc-2.27.0-1.el8.noarch perl-Error-1:0.17025-2.el8.noarch perl-Git-2.27.0-1.el8.noarch perl-TermReadKey-2.37-7.el8.x86_64
Complete!
安装Jenkins
war包下载
Jenkins download and deployment
安装运行Jenkins
运行war包
java -jar jenkins.war
在运行的日志里面可以看见提示:运行过程中已经在/root/.jenkins路径下创建了Jenkins相关的文件,其中默认用户admin,密码在/root/.jenkins/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:
7e8e8960825743fa983840ce28aec296
This may also be found at: /root/.jenkins/secrets/initialAdminPassword
*************************************************************
*************************************************************
*************************************************************
http://192.168.216.134:8080
输入默认密码:这个文件中/root/.jenkins/secrets/initialAdminPassword
安装推荐插件即可
输入你的邮箱姓名之类的输入完成