当前位置:网站首页>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>
边栏推荐
- Principle and configuration of RSTP protocol
- JXL notes
- Association modeling method in SAP segw transaction code
- It's too convenient. You can complete the code release and approval by nailing it!
- Leetcode20. Valid parentheses
- Lb10s-asemi rectifier bridge lb10s
- Talk about my drawing skills in my writing career
- 将函数放在模块中
- Flutter 绘制波浪移动动画效果,曲线和折线图
- uni-app开发语音识别app,讲究的就是简单快速。
猜你喜欢

Talk about seven ways to realize asynchronous programming

先写API文档还是先写代码?

解决 UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa2 in position 107

Cf:a. the third three number problem

MySQL --- 数据库查询 - 排序查询、分页查询

《2022年中国银行业RPA供应商实力矩阵分析》研究报告正式启动

LeetCode20.有效的括号

SAP SEGW 事物码里的 ABAP Editor

C# 对象存储

STM32 and motor development (from architecture diagram to documentation)
随机推荐
Hundred days to complete the open source task of the domestic database opengauss -- openguass minimalist version 3.0.0 installation tutorial
#yyds干货盘点# 解决名企真题:搬圆桌
爱可生SQLe审核工具顺利完成信通院‘SQL质量管理平台分级能力’评测
时钟周期
Changing JS code has no effect
Flutter InkWell & Ink组件
go 数组与切片
[cloud native] use of Nacos taskmanager task management
SAP UI5 视图里的 OverflowToolbar 控件
Concurrent performance test of SAP Spartacus with JMeter
uni-app开发语音识别app,讲究的就是简单快速。
聊聊异步编程的 7 种实现方式
Realize the addition of all numbers between 1 and number
Detailed explanation of navigation component of openharmony application development
Get you started with Apache pseudo static configuration
Shi Zhenzhen's 2021 summary and 2022 outlook | colorful eggs at the end of the article
Cf:a. the third three number problem
Talk about seven ways to realize asynchronous programming
【每日一题】1200. 最小绝对差
155. 最小栈