没有合适的资源?快使用搜索试试~ 我知道了~
首页Jenkins:代码部署自动化宝典
Jenkins:代码部署自动化宝典
需积分: 10 7 下载量 76 浏览量
更新于2024-07-23
收藏 24.56MB PDF 举报
"Jenkins, the definitive guide"
本书是关于Jenkins的经典指南,Jenkins是一款由Oracle公司开发的开源持续集成工具,广泛应用于各大IT公司的系统管理员。它旨在帮助开发者实现代码自动化部署,提高软件开发的效率和质量。
在书中,作者John Ferguson Smart探讨了Jenkins的各个方面,包括其前身Hudson的历史以及为何从Hudson演变为Jenkins的原因。对于那些犹豫不决于选择Jenkins还是Hudson的读者,书中提供了明确的指导,帮助他们做出适合自己的决策。
书中首先介绍了Jenkins的基本概念和持续集成的基础知识,强调了持续集成对于软件开发过程的重要性。通过六个阶段,逐步展示了如何将持续集成引入到组织中:
1. 第一阶段——没有构建服务器,描述了没有自动化构建环境时的开发状态。
2. 第二阶段——夜间构建,引入了定期自动构建的概念。
3. 第三阶段——夜间构建和基础自动化测试,开始实现构建后的自动化测试。
4. 第四阶段——引入度量指标,通过数据监控项目健康状况。
5. 第五阶段——更注重测试,增加测试的深度和广度。
6. 第六阶段——自动化验收测试和更多自动化部署,实现更高程度的自动化流程。
此外,书中还提到了字体和命令行的约定,有助于读者更好地理解书中的示例和操作。Wakaleo Consulting、CloudBees和Odd-e等公司赞助了本书,并提供了代码示例的使用指南和在线阅读的选项,便于读者深入学习和实践。
《Jenkins, the definitive guide》是一本全面介绍Jenkins的权威书籍,无论你是初学者还是经验丰富的系统管理员,都能从中获取宝贵的实战经验和深入理解,提升你的自动化部署能力。通过阅读此书,你可以学习如何有效地利用Jenkins来实现持续集成,提升软件开发团队的生产力和软件质量。
xv
7.26. Managing project roles .......................................................................................... 191
7.27. Assigning roles to users ........................................................................................ 191
7.28. Configuring the Audit Trail plugin .......................................................................... 192
7.29. Setting up Job Configuration History ....................................................................... 193
7.30. Viewing Job Configuration History ......................................................................... 194
7.31. Viewing differences in Job Configuration History ...................................................... 194
8.1. Configuring email notification .................................................................................. 197
8.2. Configuring advanced email notification .................................................................... 199
8.3. Configuring email notification triggers ....................................................................... 201
8.4. Customized notification message .............................................................................. 202
8.5. Claiming a failed build ........................................................................................... 203
8.6. RSS Feeds in Jenkins ............................................................................................. 204
8.7. Creating a build radiator view .................................................................................. 205
8.8. Displaying a build radiator view ............................................................................... 206
8.9. Installing the Jenkins IM plugins .............................................................................. 207
8.10. Jenkins needs its own dedicated IM user account ....................................................... 207
8.11. Setting up basic Jabber notification in Jenkins ........................................................... 208
8.12. Advanced Jabber configuration ............................................................................... 208
8.13. Jenkins Jabber messages in action ........................................................................... 210
8.14. Install the Jenkins IRC plugins ............................................................................... 211
8.15. Advanced IRC notification configuration .................................................................. 212
8.16. Advanced build job IRC notification configuration ..................................................... 213
8.17. IRC notification messages in action ......................................................................... 214
8.18. Jenkins notifications in Eclipse ............................................................................... 215
8.19. Launching the Jenkins Tray Application ................................................................... 216
8.20. Running the Jenkins Tray Application ...................................................................... 216
8.21. Creating a Notifo service for your Jenkins instance ..................................................... 218
8.22. Configuring Notifo notifications in your Jenkins build job ........................................... 218
8.23. Receiving a Notifo notification on an iPhone ............................................................. 219
8.24. Using the Hudson Helper iPhone app ....................................................................... 220
8.25. Sending SMS notifications via an SMS Gateway Service ............................................. 221
8.26. Receiving notification via SMS .............................................................................. 222
8.27. Configuring Jenkins Sounds rules in a build job ......................................................... 223
8.28. Configuring Jenkins Sounds ................................................................................... 223
8.29. Configuring Jenkins Speaks ................................................................................... 224
8.30. A Nabaztag ......................................................................................................... 225
8.31. Configuring your Nabaztag .................................................................................... 226
9.1. It is easy to configure Checkstyle rules in Eclipse ........................................................ 230
9.2. Configuring PMD rules in Eclipse ............................................................................ 233
9.3. Generating code quality reports in a Maven build ........................................................ 239
9.4. Configuring the violations plugin for a Freestyle project ................................................ 240
9.5. Violations over time ............................................................................................... 241
9.6. Violations for a given build ..................................................................................... 241
xvi
9.7. Configuring the violations plugin for a Freestyle project ................................................ 243
9.8. Configuring the violations plugin for a Maven project .................................................. 243
9.9. Jenkins Maven build jobs understand Maven multimodule structures ............................... 244
9.10. Activating the Violations plugin for an individual module ............................................ 245
9.11. Installing the Checkstyle and Static Analysis Utilities plugins ....................................... 246
9.12. Configuring the Checkstyle plugin .......................................................................... 247
9.13. Displaying Checkstyle trends ................................................................................. 247
9.14. A coverage/complexity scatter plot .......................................................................... 248
9.15. You can click on any point in the graph to investigate further ....................................... 249
9.16. Configuring the Task Scanner plugin is straightforward ............................................... 250
9.17. The Open Tasks Trend graph ................................................................................. 250
9.18. Code quality reporting by Sonar ............................................................................. 251
9.19. Jenkins and Sonar ................................................................................................ 252
9.20. Configuring Sonar in Jenkins ................................................................................. 253
9.21. Configuring Sonar in a build job ............................................................................. 254
9.22. Scheduling Sonar builds ........................................................................................ 254
10.1. Creating a parameterized build job .......................................................................... 258
10.2. Adding a parameter to the build job ........................................................................ 258
10.3. Adding a parameter to the build job ........................................................................ 259
10.4. Demonstrating a build parameter ............................................................................. 259
10.5. Adding a parameter to a Maven build job ................................................................. 260
10.6. Many different types of parameters are available ........................................................ 261
10.7. Configuring a Choice parameter .............................................................................. 261
10.8. Configuring a Run parameter ................................................................................. 262
10.9. Configuring a File parameter .................................................................................. 262
10.10. Adding a parameter to build from a Subversion tag ................................................... 263
10.11. Building from a Subversion tag ............................................................................. 263
10.12. Configuring a parameter for a Git tag ..................................................................... 264
10.13. Building from a Git tag ....................................................................................... 264
10.14. Jenkins stores what parameter values where used for each build .................................. 265
10.15. Jenkins stores what parameter values where used for each build .................................. 266
10.16. Adding a parameterized trigger to a build job .......................................................... 266
10.17. The build job you trigger must also be a parameterized build job ................................. 267
10.18. Passing a predefined parameter to a parameterized build job ....................................... 268
10.19. Creating a multiconfiguration build job ................................................................... 269
10.20. Adding an axis to a multiconfiguration build ........................................................... 269
10.21. Defining an axis of slave nodes ............................................................................ 270
10.22. Defining an axis of JDK versions .......................................................................... 270
10.23. Defining a user-defined axis ................................................................................. 271
10.24. Multiconfiguration build results ............................................................................. 272
10.25. Setting up a combination filter .............................................................................. 273
10.26. Build results using a combination filter ................................................................... 274
10.27. A job generated by the Maven Jenkins plugin .......................................................... 276
xvii
10.28. jenkins-master job generated ................................................................................. 277
10.29. Artifactory Jenkins plugin configuration ................................................................. 280
10.30. Triggering several other builds after a build job ....................................................... 282
10.31. A build job dependency graph .............................................................................. 283
10.32. Configuring a join in the phoenix-web-tests build job ................................................ 284
10.33. A more complicated build job dependency graph ...................................................... 284
10.34. Adding a new lock ............................................................................................. 285
10.35. Configuring a build job to use a lock ..................................................................... 285
10.36. Configuring a Maven release using the M2Release plugin .......................................... 287
10.37. The Perform Maven Release menu option ............................................................... 287
10.38. Performing a Maven release in Jenkins ................................................................... 288
10.39. Adding a “Copy artifacts from another project” build step .......................................... 289
10.40. Running web tests against a copied WAR file .......................................................... 291
10.41. Copying from a multiconfiguration build ................................................................ 292
10.42. Build jobs in the promotion process ....................................................................... 293
10.43. Configuring a build promotion process ................................................................... 294
10.44. Configuring a manual build promotion process ........................................................ 295
10.45. Viewing the details of a build promotion ................................................................ 296
10.46. Using fingerprints in the build promotion process ..................................................... 297
10.47. Fetching the WAR file from the upstream build job .................................................. 297
10.48. Archiving the WAR file for use in the downstream job .............................................. 298
10.49. Fetching the WAR file from the integration job ........................................................ 298
10.50. We need to determine the fingerprint of the WAR file we use ..................................... 298
10.51. Fetching the latest promoted WAR file ................................................................... 299
10.52. Promoted builds are indicated by a star in the build history ......................................... 299
10.53. Reporting on aggregate test results ........................................................................ 300
10.54. Viewing aggregate test results ............................................................................... 301
10.55. Configuring a manual step in the build pipeline ........................................................ 302
10.56. Creating a Build Pipeline view .............................................................................. 302
10.57. Configuring a Build Pipeline view ......................................................................... 303
10.58. A Build Pipeline in action .................................................................................... 304
11.1. Managing slave nodes ........................................................................................... 306
11.2. Creating a new slave node ..................................................................................... 307
11.3. Creating a Unix slave node .................................................................................... 307
11.4. Taking a slave off-line when idle ............................................................................ 309
11.5. Configuring tool locations ..................................................................................... 310
11.6. Your new slave node in action ............................................................................... 310
11.7. Creating a slave node for JNLP .............................................................................. 311
11.8. Launching a slave via Java Web Start ...................................................................... 312
11.9. The Jenkins slave agent in action ............................................................................ 312
11.10. The Jenkins slave failing to connect to the master ..................................................... 313
11.11. Configuring the Jenkins slave port ......................................................................... 313
11.12. Installing the Jenkins slave as a Windows service ..................................................... 314
xviii
11.13. Managing the Jenkins Windows service .................................................................. 314
11.14. Letting Jenkins control a Windows slave as a Windows service ................................... 315
11.15. Running a build job on a particular slave node ......................................................... 316
11.16. Jenkins proactively monitors your build agents ........................................................ 318
11.17. You manage your EC2 instances using the Amazon AWS Management Console ............. 319
11.18. Configuring an Amazon EC2 slave ........................................................................ 320
11.19. Configuring an Amazon EC2 slave ........................................................................ 321
11.20. Creating a new Amazon EC2 image ....................................................................... 322
11.21. Bringing an Amazon EC2 slave online manually ...................................................... 322
12.1. A simple automated deployment pipeline .................................................................. 331
12.2. Copying the binary artifact to be deployed ................................................................ 331
12.3. Deploying to Tomcat using the Deploy Plugin ........................................................... 332
12.4. Adding a “Build selector for Copy Artifact” parameter ................................................ 333
12.5. Configuring a build selector parameter ..................................................................... 333
12.6. Specify where to find the artifacts to be deployed ...................................................... 334
12.7. Choosing the build to redeploy ............................................................................... 334
12.8. Using the “Specified by permalink” option ............................................................... 335
12.9. Using a specific build ........................................................................................... 335
12.10. Using a Maven Enterprise Repository .................................................................... 336
12.11. Deploying an artifact from a Maven repository ........................................................ 339
12.12. Preparing the WAR to be deployed ........................................................................ 339
12.13. Configuring a remote host .................................................................................... 340
12.14. Deploying files to a remote host in the build section ................................................. 341
12.15. Deploying files to a remote host in the post-build actions ........................................... 342
13.1. Discarding old builds ............................................................................................ 345
13.2. Discarding old builds—advanced options .................................................................. 346
13.3. Viewing disk usage .............................................................................................. 347
13.4. Displaying disk usage for a project .......................................................................... 347
13.5. Displaying project disk usage over time ................................................................... 348
13.6. Maven build jobs—advanced options ....................................................................... 348
13.7. Jenkins Load Statistics .......................................................................................... 350
13.8. The Jenkins Monitoring plugin ............................................................................... 351
13.9. The builds directory ............................................................................................. 352
13.10. The Jenkins Backup Manager Plugin ...................................................................... 353
13.11. Configuring the Jenkins Backup Manager ............................................................... 354
13.12. Configuring the Thin Backup plugin ...................................................................... 355
13.13. Restoring a previous configuration ......................................................................... 355
13.14. Reloading the configuration from disk .................................................................... 356
13.15. Jenkins will inform you if your data is not compatible with the current version ............... 357
13.16. Managing out-of-date build jobs data ..................................................................... 358
A.1. A project containing freely-named test classes ............................................................ 364
Copyright
Copyright © 2011 John Ferguson Smart
Printed version published by O'Reilly Media, 1005 Gravenstein Highway North, Sebastopol, CA 95472.
Online version published by Wakaleo Consulting, 111 Donald Street, Karori, Wellington 6012, New
Zealand.
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works
3.0 United States license. For more information about this license, see http://creativecommons.org/
licenses/by-nc-nd/3.0/us/. You are free to share, copy, distribute, display, and perform the work under
the following conditions:
• You must attribute the work to John Ferguson Smart
• You may not use this work for commercial purposes.
• You may not alter, transform, or build upon this work.
Java™ and all Java-based trademarks and logos are trademarks or registered trademarks of Sun
Microsystems, Inc., in the United States and other countries.
Eclipse™ is a trademark of the Eclipse Foundation, Inc., in the United States and other countries.
Apache and the Apache feather logo are trademarks of The Apache Software Foundation.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in this book, and Wakaleo Consulting was aware of a
trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors assume
no responsibility for errors or omissions, or for damages resulting from the use of the information
contained herein.
剩余416页未读,继续阅读
2017-03-24 上传
2018-05-12 上传
2018-05-21 上传
2014-05-23 上传
2021-05-02 上传
2007-05-31 上传
2007-10-12 上传
2022-08-03 上传
riggs309
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- R语言中workflows包的建模工作流程解析
- Vue统计工具项目配置与开发指南
- 基于Spearman相关性的协同过滤推荐引擎分析
- Git基础教程:掌握版本控制精髓
- RISCBoy: 探索开源便携游戏机的设计与实现
- iOS截图功能案例:TKImageView源码分析
- knowhow-shell: 基于脚本自动化作业的完整tty解释器
- 2011版Flash幻灯片管理系统:多格式图片支持
- Khuli-Hawa计划:城市空气质量与噪音水平记录
- D3-charts:轻松定制笛卡尔图表与动态更新功能
- 红酒品质数据集深度分析与应用
- BlueUtils: 经典蓝牙操作全流程封装库的介绍
- Typeout:简化文本到HTML的转换工具介绍与使用
- LeetCode动态规划面试题494解法精讲
- Android开发中RxJava与Retrofit的网络请求封装实践
- React-Webpack沙箱环境搭建与配置指南
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功