当前位置:网站首页>持续交付-Blue Ocean 应用
持续交付-Blue Ocean 应用
2022-06-27 00:36:00 【51CTO】
Blue Ocean 提供了一套可视化操作界面来帮助创建、编辑 Pipeline 任务。
Blue Ocean 特性:
- 流水线编辑器:用于创建贯穿始终的持续交付流水线,是一种直观并可视化的流水线编辑器。
- 流水线的可视化:对流水线的可视化表示,提高了全企业范围内持续交付过程的清晰度。
- 流水线的诊断:即刻定位自动化问题,无需持续扫描日志或关注多个屏幕。
- 个性化仪表盘:用户可以自定义仪表盘,只显示与自身相关的流水线。
安装与启动 Blue Ocean
Blue Ocean 是 Jenkins 插件之一,在系统管理->插件管理,"可选插件" 中搜索 "Blue Ocean" 可以看到如下结果:
 持续交付-Blue Ocean 应用_单元测试](/img/ea/4f1f0afcebe2234e205f0f81d3328e.png)
选中 Blue Ocean,然后单击 Install 按钮进行安装。安装完成之后重启 Jenkins 进程,之后就可以在 Jenkins 页面上看到 Blue Ocean 的图标。单击 Blue Ocean 图标启动即可启动 Blue Ocean。
在 Blue Ocean 中创建 Pipeline
在 Blue Ocean 中单击 New Pipeline 创建新的流水线。 创建 Pipeline
 持续交付-Blue Ocean 应用_图形化_02](/img/08/eacd9c4b2c99a5bfdfd3197d395559.png)
如果你的仓库根目录有 Jenkinsfile,则直接开始第一次构建过程。如果仓库中不含 Jenkinsfile 则开启 pipeline-editor,图形化编辑工作流。 Blue Ocean 图形化编辑工作流
 持续交付-Blue Ocean 应用_单元测试_03](/img/b6/cf2c8eb4ff762526a754f61f9e3b1f.png)
编辑完后会生成 Jenkinsfile,并提交到你的代码库根目录,你可以选择提交到 master 分支或者提交到一个新创建的分支。提交成功之后就会开始执行一次完整的构建过程。 Blue Ocean 创建 Pipeline 提交代码库 & 运行
 持续交付-Blue Ocean 应用_git_04](/img/70/396ecb365d52acf0f0f935c347dacb.png)
由 Blue Ocean 生成的 Jenkinsfile 代码会被保存到项目的 Github 代码库中,后期可以对其进行编辑、修改。 Blue Ocean 生成的 Jenkinsfile 代码
在 Blue Ocean 中运行构建与视图使用
运行构建
在 Blue Ocean 中打开 Pipeline 任务,单击 Run 按钮可以直接运行该任务。 Blue Ocean 中运行 Pipeline 任务
 持续交付-Blue Ocean 应用_单元测试_05](/img/33/7e57e41d1086e5c70d718e8927d78c.png)
查看任务进度视图
在运行 Pipeline 任务过程中可以单击任务编号进入任务详情视图查看图形化进度。 Blue Ocean 任务进度查询
 持续交付-Blue Ocean 应用_图形化_06](/img/dc/83061b10b7d2416dd40b18e98a1cf7.png)
查看日志视图
单击任务中对应的工作节点,可以查询任务运行过程中的日志详情。这些日志信息可以用于调试任务,特别是在任务出错的时候,日志详情可以帮助检查任务出错的原因。 任务日志
 持续交付-Blue Ocean 应用_单元测试_07](/img/1b/c6b284a8bfd731e8ecd3f676ec069d.jpg)
使用 Blue Ocean 进行单元测试与结果展示
对于包含单元测试的项目,Blue Ocean 可以运行单元测试并对其结果进行展示。下面用 java 单测项目进行举例。
Pipeline代码实现
pipeline{
agent {
label 'master'
}
stages{
stage('iTest源码') {
steps {
sh 'mkdir -p iTest'
dir("iTest"){
git branch:'master', url:'[email protected]:princeqjzh/iTest.git'
}
}
}
stage('构建+单测') {
steps {
sh '''
cd iTest
mvn clean install test
'''
}
}
stage('发布测试记录') {
steps {
junit '**/*.xml'
}
}
}
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
单测结果展示
在任务运行完成之后,进入 Tests 视图查看测试运行结果 单测结果展示
 持续交付-Blue Ocean 应用_图形化_08](/img/91/ae22d82c29b309e05b607d3dc8330f.png)
Blue Ocean为开发人员提供了更具乐趣的 Jenkins 使用方式,从基础开始构建,实现了一种全新的、现代风格的用户界面,有助于任何规模的团队实现持续交付。
边栏推荐
- Custom class loader encrypts and decrypts classes
- Custom jsp[if, foreach, data, select] tag
- Beyond lithium battery -- the concept of battery in the future
- Moher College - SQL injection vulnerability test (error reporting and blind note)
- Interface test framework practice (I) | requests and interface request construction
- memcached基础6
- 建模规范:环境设置
- Find the minimum value in the rotation sort array ii[classical Abstract dichotomy + how to break the game left, middle and right are equal]
- At present, which securities company is the best and safest to open an account for stock speculation?
- Memcached foundation 2
猜你喜欢

使用NetworkX对社交网络进行系统的分析:Facebook网络分析案例

ESP32-SOLO开发教程,解决CONFIG_FREERTOS_UNICORE问题

2022年地理信息系统与遥感专业就业前景与升学高校排名选择

05 | 規範設計(下):commit 信息風格迥异、難以閱讀,如何規範?

3-wire SPI screen driving mode

One click acceleration of Sony camera SD card file copy operation, file operation batch processing tutorial

Custom class loader encrypts and decrypts classes

What are the skills and methods for slip ring installation

TopoLVM: 基于LVM的Kubernetes本地持久化方案,容量感知,动态创建PV,轻松使用本地磁盘

Unable to create a folder to save the sketch: MKDIR sketch
随机推荐
Play OLED, u8g2 animation, increasing numbers, random triangles, etc
Flink practical problems (VII): no watermark (watermarks are only available eventtime is used)
Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
XML learning notes
Great vernacular with high concurrency (I)
buuctf-pwn write-ups (6)
Interface test framework practice (I) | requests and interface request construction
How to control the quality of HD slip ring in the production process
leetcode 1143. Longest Commom Subsequence 最长公共子序列(中等)
Keepalived 实现 Redis AutoFailover (RedisHA)17
idea 热启动失效解决方案
2022 Health Expo, Shandong health care exhibition, postpartum health and sleep health exhibition
JSON解析,ESP32轻松获取时间气温和天气
IIS deploy static web site and FTP service
05 | standard design (Part 2): how to standardize the different styles of commit information, which are difficult to read?
3 - wire SPI Screen Drive
接口测试框架实战(一) | Requests 与接口请求构造
07 | workflow design: how to design a reasonable multi person development mode?
LeetCode 142. Circular linked list II
自定义类加载器对类加密解密