当前位置:网站首页>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>
边栏推荐
- Flutter 绘制波浪移动动画效果,曲线和折线图
- The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
- 【每日一题】1200. 最小绝对差
- 使用Dom4j解析XML
- MySQL giant pit: update updates should be judged with caution by affecting the number of rows!!!
- Difference between avc1 and H264
- Shu tianmeng map × Weiyan technology - Dream map database circle of friends + 1
- Association modeling method in SAP segw transaction code
- 山东大学暑期实训一20220620
- A small talk caused by the increase of sweeping
猜你喜欢

SAE international strategic investment geometry partner

Introduction aux contrôles de la page dynamique SAP ui5

函数传递参数小案例

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

Natural language processing series (I) introduction overview
![[cloud native] use of Nacos taskmanager task management](/img/ad/24bdd4572ef9990238913cb7cd16f8.png)
[cloud native] use of Nacos taskmanager task management

精彩速递|腾讯云数据库6月刊

Overflow toolbar control in SAP ui5 view

百度杯”CTF比赛 2017 二月场,Web:爆破-2

UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xe6 in position 76131: invalid continuation byt
随机推荐
Hiengine: comparable to the local cloud native memory database engine
《2022年中国银行业RPA供应商实力矩阵分析》研究报告正式启动
Talking about fake demand from takeout order
关于 SAP UI5 floating footer 显示与否的单步调试以及使用 SAP UI5 的收益
阿里云SLB负载均衡产品基本概念与购买流程
山东大学暑期实训一20220620
Datapipeline was selected into the 2022 digital intelligence atlas and database development report of China Academy of communications and communications
Hundred days to complete the open source task of the domestic database opengauss -- openguass minimalist version 3.0.0 installation tutorial
事务的基本特性和隔离级别
Solve Unicode decodeerror: 'GBK' codec can't decode byte 0xa2 in position 107
【每日一题】1200. 最小绝对差
《2022年中國銀行業RPA供應商實力矩陣分析》研究報告正式啟動
从外卖点单浅谈伪需求
My colleague didn't understand selenium for half a month, so I figured it out for him in half an hour! Easily showed a wave of operations of climbing Taobao [easy to understand]
946. 验证栈序列
爱可生SQLe审核工具顺利完成信通院‘SQL质量管理平台分级能力’评测
AVC1与H264的区别
MySQL giant pit: update updates should be judged with caution by affecting the number of rows!!!
将函数放在模块中
Discussion on error messages and API versions of SAP ui5 getsaplogonlanguage is not a function