当前位置:网站首页>jenkins安装
jenkins安装
2022-07-05 13:06:00 【可以吧可以吧】
目录
三、安装javajdk、安装maven、安装node、安装git
六、我踩的坑(到这里jenkins的安装就已经完成了,下面是一些补充)
一、基础环境准备
一个良好的基础环境可以避免一部分不必要的错误
1.关闭防火墙
systemctl stop firewalld
2.关闭selinux
setenforce 0 sed -i "s/SELINUX=.*$/SELINUX=disabled/g" /etc/selinux/config
二、安装jenkins
1.jenkins官方yum源安装
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
2.安装jenkins
yum -y install java-1.8.0-openjdk jenkins systemctl restart jenkins
注:这里jenkins起不来,很有可能是jdk的问题不妨换个jdk试试看
三、安装javajdk、安装maven、安装node、安装git
1.javajdk安装
[[email protected] opt]# tar -xf jdk-17_linux-x64_bin.tar.gz [[email protected] opt]# mv jdk-17 /usr/local/jdk [[email protected] opt]# vi /etc/profile export JAVA_HOME=/usr/local/jdk export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$PATH[[email protected] opt]# source /etc/profile
[[email protected] opt]# java -version
java version "17" 2021-09-14 LTS
Java(TM) SE Runtime Environment (build 17+35-LTS-2724)
Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
2.maven安装
[[email protected] opt]# tar -xf apache-maven-3.5.4-bin.tar.gz [[email protected] opt]# mv apache-maven-3.5.4-bin /usr/lcoal/maven [[email protected] opt]# vi /etc/profile #maven export MAVEN_HOME=/usr/local/maven export PATH=$MAVEN_HOME/bin:$PATH[[email protected] opt]# source /etc/profile
[[email protected] opt]# mvn -v
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)
Maven home: /usr/local/maven
Java version: 17, vendor: Oracle Corporation, runtime: /usr/local/jdk
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1160.el7.x86_64", arch: "amd64", family: "unix"
3.git安装
[[email protected] opt]# yum -y install git [[email protected] opt]# which git /usr/bin/git
4.node安装
[[email protected] opt]# tar -xf node-v16.10.0-linux-x64.tar.xz [[email protected] opt]# mv node-v16.10.0-linux-x64 /usr/local/nodejs [[email protected] opt]# vi /etc/profile #node export NODE_HOME=/usr/local/nodejs export PATH=$NODE_HOME/bin:$PATH export NODE_PATH=$NODE_HOME/lib/node_modules[[email protected] opt]# source /etc/profile
[[email protected] opt]# node -v
v16.10.0
[[email protected] opt]# npm -v
7.24.0
[[email protected] opt]# npm install -g cnpm --registry=https://registry.npm.taobao.org #我的安装包没有这个命令所以我需要安装以下,如果你的安装包有这个命令可以跳过这个步骤
[[email protected] opt]# cnpm -v
[email protected] (/usr/local/nodejs/lib/node_modules/cnpm/lib/parse_argv.js)
[email protected] (/usr/local/nodejs/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)
[email protected] (/usr/local/nodejs/bin/node)
[email protected] (/usr/local/nodejs/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js)
prefix=/usr/local/nodejs
linux x64 3.10.0-1160.el7.x86_64
registry=https://registry.npmmirror.com
四、jenkins初始化
1.初始化jenkins






2.汉化jenkins




3.修改admin密码


4.修改安装源为清华镜像源



https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json 用这个替换掉升级站点里面的地址。
五、jenkins全局配置

1.jenkins maven配置

2.jenkins javajdk配置

3.jenkins git配置

4.jenkins node配置
node需要安装一个nodejs的插件才能有配置

-----------------
安装完成过后重启下jenkins然后回到全局配置,k可以看到多了个nodejs

我看安装包没有cnpm所以这里还需要手动执行一遍以下命令安装cnpm,你看看你的没有的话也执行一遍
npm install -g cnpm --registry=https://registry.npm.taobao.org
六、我踩的坑(到这里jenkins的安装就已经完成了,下面是一些补充)
1.jenkins启动出问题不能正常启动或者报错,
我是换个jdk解决
2.初始化阶段显示已经离线,
https://www.cnblogs.com/socketqiang/p/10974191.html
如果有没提到的欢迎在评论区补充。
七、补充
1.配置邮箱
邮箱授权码方式,下面我就不写了,下面链接有
https://jingyan.baidu.com/article/fedf0737af2b4035ac8977ea.html
(1)配置邮箱需要安装的插件Mailer Plugin,如果没有安装的话安装以下
(2)



2.配置钉钉通知
(1)安装插件
DingTalk安装这个插件
(2)创建钉钉机器人







(3)设置钉钉

(4)在项目添加钉钉机器人
版本不同位置可能不同,有的版本在构建后操作里面,我的则是在General里面

3.忘记密码
vi /var/lib/jenkins/users/admin_*/config.xml 找到带pass的一行吧内容替换成如下,然后保存退出重启,密码变成了123456789 <passwordHash>#jbcrypt:$2a$10$Kas7FMng/zw19kOHdv41WO45mVmFgdl80gTm4xRyOCubsmF76v7B.</passwordHash>
边栏推荐
- 解决 UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa2 in position 107
- 从外卖点单浅谈伪需求
- MATLAB论文图表标准格式输出(干货)
- 将函数放在模块中
- Lb10s-asemi rectifier bridge lb10s
- MySQL 巨坑:update 更新慎用影响行数做判断!!!
- How can non-technical departments participate in Devops?
- FPGA 学习笔记:Vivado 2019.1 添加 IP MicroBlaze
- go 字符串操作
- 峰会回顾|保旺达-合规和安全双驱动的数据安全整体防护体系
猜你喜欢

C# 对象存储

It's too convenient. You can complete the code release and approval by nailing it!

MySQL giant pit: update updates should be judged with caution by affecting the number of rows!!!

The Research Report "2022 RPA supplier strength matrix analysis of China's banking industry" was officially launched

无密码身份验证如何保障用户隐私安全?

SAP UI5 DynamicPage 控件介紹

Shu tianmeng map × Weiyan technology - Dream map database circle of friends + 1

Talk about seven ways to realize asynchronous programming

Fragmented knowledge management tool memos

Asemi rectifier bridge hd06 parameters, hd06 pictures, hd06 applications
随机推荐
Asemi rectifier bridge hd06 parameters, hd06 pictures, hd06 applications
Lb10s-asemi rectifier bridge lb10s
Overflow toolbar control in SAP ui5 view
Run, open circuit
函数传递参数小案例
数据湖(七):Iceberg概念及回顾什么是数据湖
【Hot100】34. 在排序数组中查找元素的第一个和最后一个位置
Get you started with Apache pseudo static configuration
SAP SEGW 事物码里的导航属性(Navigation Property) 和 EntitySet 使用方法
[深度学习论文笔记]TransBTSV2: Wider Instead of Deeper Transformer for Medical Image Segmentation
程序员成长第八篇:做好测试工作
PyCharm安装第三方库图解
ABAP editor in SAP segw transaction code
A specific example of ABAP type and EDM type mapping in SAP segw transaction code
leetcode:221. Maximum square [essence of DP state transition]
SAP UI5 视图里的 OverflowToolbar 控件
RHCSA9
时钟周期
MySQL 巨坑:update 更新慎用影响行数做判断!!!
Write macro with word