当前位置:网站首页>Jenkins的安装及使用
Jenkins的安装及使用
2022-06-28 15:23:00 【你的小啊廖】
Jenkins是什么?
Jenkins 是⼀个独⽴的开源⾃动化服务器,可⽤于⾃动化与构建、测试、交付或部署软件相关的各种任务
对于我们测试来说工作中自然也少不了Jenkins,接下来我们就安装Jenkins
- Jenkins的安装
- 下载Jenkins War 包
进入官网https://www.jenkins.io/download/#downloading-jenkins
- 部署 Jenkins
下载完后解压到电脑文件夹
由于我们是下载的是war包,所以我们只要是可以运⾏java的地⽅就可以构建Jenkins;所以我们找到Jenkins.war 的 路径 并在改路径下进⼊cmd 或者 终端输入java -jar <jenkins.war的路径>
运行完后 ,会自动构建一个本地服务,并且会在c盘下面用户这个文件下生成一个隐藏文件夹是jenkins服务支撑,我们也可以通过搜索在cmd窗口返回出来的数据中找到路径

因为会自动生成一个本地服务,我们现在去打开它 输入本地服务网址 127.0.0.1:8080
我们会看到有这个页面需要一个管理员密码,这个密码其实就在我们在cmd窗口运行启动Jenkins中返回的数据里可以找到 搜索initialAdminPassword
我们得到密码之后 回到刚刚的网页 输入密码点击继续

然后等待安装完成
如果安装失败,通常有一下原因
1、你的插件安装更新源需要改成国内镜像源
修改Jenkins⼯作⽬录下的 hudson.model.UpdateCenter.xml ⽂件,将url 改 为http://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/updatecenter.json
修改Jenkins⼯作⽬录下的 updates/default.json ⽂件,将 updates.jenkins.io/download 全部替换
成 mirrors.tuna.tsinghua.edu.cn/jenkins 还有将 www.google.com 全部替换为 www.baidu.com
重启Jenkins服务
2、是因为你的⽹络不好导致的,所以如果出错,请重新访问,重新安装即可;
www.hctestedu.com 华测教育-CICD
正常安装成功之后,我们即可创建⼀个管理员⽤户了,⾃⼰设置管理员的⽤户名和密码
创建这个管理员后会跳转至实例配置页面 这里我们不用管直接点击保存并完成

页面跳转主页,这样我们的就完成了安装
注意如果插件安装失败:
1、将插件的名称记录下来
2、打开Jenkins 进入设置
3、进入插件管理,并将下载失败的插件名称复制搜索框进行当下载安装(插件安装需要重启才能生效)
- Jenkins的使用
简单的使⽤项⽬与操作系统交互的步骤就三步:构建任务、设置构建脚本、运⾏项
⽬
创建一个项目 也是就是新建一个任务
那么我们就来新建一个任务
其他的不用管 ,选择第一个后点确定,进入项目的配置界面
下滑至构建选项
选中后点确定,弹出一下输入框
保存后我们就进行了一个任务,页面跳转至工作台,我们就可以运行这个新建的任务了
在运行记录页面选中控制台输出按钮,进入控制台页面
注意:如果我们在pychar中终端运行命令,比如我们要运行一个test.py文件,那我们在pychar终端是不是就要输入命令python test.py
那么我们在Jenkins中,输入的命令文件地址得是绝对路径 不能直接输入python test.py且命令中不能包含中文
为啥呢?
1、因为 Jenkins运行的脚本原理是以数据的形式传递给了Jenkins
2、数据传递给Jenkins之后有保存的操作,保存的过程中数据会发生变化
怎么解决呢?
重新启动Jenkins (注意不是打开网址)
启动时 指定编码: java -Dfile.encoding=utf-8 -jar <Jenkins的路径>
边栏推荐
- Spacetutorial (continuous updating...)
- Flutter简单实现多语言国际化
- Ros21 lecture
- R language ggplot2 visualization: use the patchwork package to stack two ggplot2 visualization results vertically to form a composite diagram, and stack one visualization result on the other visualiza
- After QQ was stolen, a large number of users "died"
- [C language] how to implement plural types
- WSUS客户端访问服务端异常报错-0x8024401f「建议收藏」
- How to solve the following problems in the Seata database?
- Fleet |「后台探秘」第 3 期:状态管理
- Li Kou today's question -522 Longest special sequence
猜你喜欢

MIPS汇编语言学习-01-两数求和以及环境配置、如何运行

当下不做元宇宙,就像20年前没买房!

蔚来潜藏的危机:过去、现在到未来

go-zero 微服务实战系列(七、请求量这么高该如何优化)
![[C language] implementation of binary tree and three Traversals](/img/9f/384a73fb82265a76fc5eef884ce279.png)
[C language] implementation of binary tree and three Traversals
DBMS in Oracle_ output. put_ Line output problem solving process

论文解读(GCC)《Efficient Graph Convolution for Joint Node RepresentationLearning and Clustering》

Cross cluster deployment of helm applications using karmada
ORACLE中dbms_output.put_line输出问题的解决过程
![Experiment 6 8255 parallel interface experiment [microcomputer principle] [experiment]](/img/70/394ccf6e08a0774acade1eb1b8bf00.png)
Experiment 6 8255 parallel interface experiment [microcomputer principle] [experiment]
随机推荐
Application of mongodb in Tencent retail premium code
Smart supplier management system for chemical manufacturing industry deeply explores the field of supplier management and improves supply chain collaboration
[C language] implementation of binary tree and three Traversals
PostgreSQL实现按年、月、日、周、时、分、秒的分组统计
买卖股票的最佳时机
MIPS assembly language learning -02- logic judgment - foreground input
[C language] how to generate normal or Gaussian random numbers
Spacetutorial (continuous updating...)
坐拥1200亿,她又要IPO敲钟了
R语言ggplot2可视化:使用patchwork包将两个ggplot2可视化结果横向构成新的结果可视化组合图(使用|符号)
【算法篇】刷了两道大厂面试题,含泪 ”重学数组“
叮!Techo Day 腾讯技术开放日如约而至!
Analysis of PostgreSQL storage structure
Gbase Nantah General Motors appears at the 6th World Intelligence Conference
关于针对tron API签名广播时使用curl的json解析问题解决方案及针对json.loads方法的问题记录
Technical secrets of ByteDance data platform: implementation and optimization of complex query based on Clickhouse
一种跳板机的实现思路
How can the digital intelligent supply chain management platform of the smart Park optimize process management and drive the development of the park to increase speed and quality?
Halcon basic summary (I) cutting pictures and rotating images
With 120billion yuan, she will ring the bell for IPO again