Jenkins

Jenkins pdf epub mobi txt 電子書 下載2025

出版者:O'Reilly Media
作者:John Ferguson Smart
出品人:
頁數:406
译者:
出版時間:2011-7-11
價格:USD 47.99
裝幀:Paperback
isbn號碼:9781449305352
叢書系列:
圖書標籤:
  • 持續集成
  • CI
  • 軟件開發
  • 敏捷開發
  • 軟件工程
  • O'Reilly
  • Java
  • 計算機
  • 軟件工程
  • 持續集成
  • 自動化
  • 開源
  • DevOps
  • 構建
  • 測試
  • 部署
  • 工具
  • 流程
想要找書就要到 小美書屋
立刻按 ctrl+D收藏本頁
你會得到大驚喜!!

具體描述

Learn how to automate your build, integration, release and deployment process with Jenkins, the popular Java-based open source tool that has revolutionized the way teams think about continuous integration (CI). This concise guide shows you how to seamlessly include Jenkins in the development process—and demonstrates how CI can save you time, money, and many headaches.

Ideal whether you're a developer, software architect, or project manager, Jenkins: The Definitive Guide provides a tutorial on CI as well as a comprehensive reference for using Jenkins. You get a wealth of best practices and real-world tips to help you get the most out of this tool. And you’ll quickly discover how Jenkins' intuitive user interface and powerful features make setting up a CI service a real breeze.

Get a complete tour of Jenkins, and learn how to install and configure this tool

Set up, organize, and monitor your build jobs

Learn about advanced build job configuration, including build pipelines, parameterized build jobs, and matrix builds

Automate tests and code quality metrics

Put in place effective team notification strategies and techniques

Secure your Jenkins server

Automate your deployment process

Use Jenkins for distributed builds, and implement CI on large projects

Become familiar with Jenkins plugins—and learn how to write your own

Use Jenkins with other programming languages, including Groovy, Grails and .NET

著者簡介

John is a freelance consultant specializing in Enterprise Java, Web Development, and Open Source technologies, currently based in Wellington, New Zealand. Well known in the Java community for his many published articles, John helps organizations optimize their Java development processes and infrastructures and provides training and mentoring in open source technologies, SDLC tools, and agile development processes. John is principal consultant at Wakaleo Consulting http://www.wakaleo.com/ (http://www.wakaleo.com), a company that provides consulting, training and mentoring services in Enterprise Java and Agile Development.

圖書目錄

Copyright .................................................................................................................... xix
Foreword ..................................................................................................................... xxi
Preface ...................................................................................................................... xxiii
1. Audience ....................................................................................................... xxiii
2. Book Layout .................................................................................................. xxiii
3. Jenkins or Hudson? ......................................................................................... xxiii
4. Font Conventions ............................................................................................ xxiv
5. Command-Line Conventions ............................................................................. xxiv
6. Contributors .................................................................................................... xxv
7. The Review Team ........................................................................................... xxvi
8. Book Sponsors ................................................................................................ xxvi
...8.1. Wakaleo Consulting .............................................................................. xxvi
...8.2. CloudBees .......................................................................................... xxvii
...8.3. Odd-e ................................................................................................ xxvii
9. Using Code Examples .................................................................................... xxviii
10. Safari® Books Online ................................................................................... xxviii
11. How to Contact Us ........................................................................................ xxix
12. Acknowledgments .......................................................................................... xxix
...1. Introducing Jenkins ......................................................................................................1
......1.1. Introduction .....................................................................................................1
......1.2. Continuous Integration Fundamentals ....................................................................1
......1.3. Introducing Jenkins (née Hudson) ........................................................................2
......1.4. From Hudson to Jenkins—A Short History ............................................................3
......1.5. Should I Use Jenkins or Hudson? .........................................................................4
......1.6. Introducing Continuous Integration into Your Organization ....................................... 5
.........1.6.1. Phase 1—No Build Server .......................................................................5
.........1.6.2. Phase 2—Nightly Builds ..........................................................................5
.........1.6.3. Phase 3—Nightly Builds and Basic Automated Tests .....................................5
.........1.6.4. Phase 4—Enter the Metrics ......................................................................6
.........1.6.5. Phase 5—Getting More Serious About Testing .............................................6
.........1.6.6. Phase 6—Automated Acceptance Tests and More Automated Deployment.........6
.........1.6.7. Phase 7—Continuous Deployment .............................................................6
......1.7. Where to Now? ................................................................................................ 7
...2. Your First Steps with Jenkins ........................................................................................ 9
......2.1. Introduction ..................................................................................................... 9
......2.2. Preparing Your Environment ............................................................................... 9
.........2.2.1. Installing Java ...................................................................................... 10
.........2.2.2. Installing Git ........................................................................................ 11
.........2.2.3. Setting Up a GitHub Account .................................................................. 11
.........2.2.4. Configuring SSH Keys ........................................................................... 12
.........2.2.5. Forking the Sample Repository ................................................................ 12
......2.3. Starting Up Jenkins .......................................................................................... 14
......2.4. Configuring the Tools ...................................................................................... 17
.........2.4.1. Configuring Your Maven Setup ............................................................... 18
.........2.4.2. Configuring the JDK ............................................................................. 19
.........2.4.3. Notification .......................................................................................... 20
.........2.4.4. Setting Up Git ...................................................................................... 20
......2.5. Your First Jenkins Build Job ............................................................................. 21
......2.6. Your First Build Job in Action .......................................................................... 26
......2.7. More Reporting—Displaying Javadocs ................................................................ 33
......2.8. Adding Code Coverage and Other Metrics ........................................................... 35
......2.9. Conclusion ..................................................................................................... 41
...3. Installing Jenkins ....................................................................................................... 43
......3.1. Introduction .................................................................................................... 43
......3.2. Downloading and Installing Jenkins .................................................................... 43
......3.3. Preparing a Build Server for Jenkins ................................................................... 46
......3.4. The Jenkins Home Directory ............................................................................. 47
......3.5. Installing Jenkins on Debian or Ubuntu ............................................................... 48
......3.6. Installing Jenkins on Redhat, Fedora, or CentOS ................................................... 49
......3.7. Installing Jenkins on SUSE or OpenSUSE ........................................................... 50
......3.8. Running Jenkins as a Stand-Alone Application ..................................................... 51
......3.9. Running Jenkins Behind an Apache Server .......................................................... 54
......3.10. Running Jenkins on an Application Server .......................................................... 55
......3.11. Memory Considerations .................................................................................. 56
......3.12. Installing Jenkins as a Windows Service ............................................................ 56
......3.13. What’s in the Jenkins Home Directory ............................................................... 60
......3.14. Backing Up Your Jenkins Data ........................................................................ 64
......3.15. Upgrading Your Jenkins Installation .................................................................. 64
......3.16. Conclusion ................................................................................................... 65
...4. Configuring Your Jenkins Server .................................................................................. 67
......4.1. Introduction .................................................................................................... 67
......4.2. The Configuration Dashboard—The Manage Jenkins Screen .................................... 67
......4.3. Configuring the System Environment .................................................................. 70
......4.4. Configuring Global Properties ............................................................................ 71
......4.5. Configuring Your JDKs .................................................................................... 72
......4.6. Configuring Your Build Tools ........................................................................... 74
.........4.6.1. Maven ................................................................................................. 74
.........4.6.2. Ant ..................................................................................................... 76
.........4.6.3. Shell-Scripting Language ........................................................................ 77
......4.7. Configuring Your Version Control Tools ............................................................. 77
.........4.7.1. Configuring Subversion .......................................................................... 77
.........4.7.2. Configuring CVS .................................................................................. 77
......4.8. Configuring the Mail Server .............................................................................. 78
......4.9. Configuring a Proxy ........................................................................................ 79
......4.10. Conclusion ................................................................................................... 80
...5. Setting Up Your Build Jobs ......................................................................................... 81
......5.1. Introduction .................................................................................................... 81
......5.2. Jenkins Build Jobs ........................................................................................... 81
......5.3. Creating a Freestyle Build Job ........................................................................... 82
.........5.3.1. General Options .................................................................................... 82
.........5.3.2. Advanced Project Options ...................................................................... 84
......5.4. Configuring Source Code Management ................................................................ 85
.........5.4.1. Working with Subversion ....................................................................... 86
.........5.4.2. Working with Git .................................................................................. 88
......5.5. Build Triggers ...............................................................................................100
.........5.5.1.TriggeringaBuildJobOnceAnotherBuildJobHasFinished...................... 101
.........5.5.2. Scheduled Build Jobs ........................................................................... 101
.........5.5.3. Polling the SCM ................................................................................. 102
.........5.5.4. Triggering Builds Remotely .................................................................. 103
.........5.5.5. Manual Build Jobs ............................................................................... 105
......5.6. Build Steps ................................................................................................... 105
.........5.6.1. Maven Build Steps .............................................................................. 105
.........5.6.2. Ant Build Steps .................................................................................. 107
.........5.6.3. Executing a Shell or Windows Batch Command ........................................ 107
.........5.6.4. Using Jenkins Environment Variables in Your Builds ................................. 109
.........5.6.5. Running Groovy Scripts ....................................................................... 111
.........5.6.6. Building Projects in Other Languages ..................................................... 113
......5.7. Post-Build Actions ......................................................................................... 113
.........5.7.1. Reporting on Test Results ..................................................................... 113
.........5.7.2. Archiving Build Results ....................................................................... 114
.........5.7.3. Notifications ....................................................................................... 117
.........5.7.4. Building Other Projects ........................................................................ 118
......5.8. Running Your New Build Job .......................................................................... 118
......5.9. Working with Maven Build Jobs ...................................................................... 118
.........5.9.1. Building Whenever a SNAPSHOT Dependency Is Built .............................. 119
.........5.9.2. Configuring the Maven Build ................................................................ 120
.........5.9.3. Post-Build Actions ............................................................................... 121
.........5.9.4. Deploying to an Enterprise Repository Manager ........................................ 122
.........5.9.5. Deploying to Commercial Enterprise Repository Managers .......................... 125
.........5.9.6. Managing Modules .............................................................................. 126
.........5.9.7. Extra Build Steps in Your Maven Build Jobs ............................................ 127
......5.10. Using Jenkins with Other Languages ............................................................... 127
.........5.10.1. Building Projects with Grails ............................................................... 127
.........5.10.2. Building Projects with Gradle .............................................................. 129
.........5.10.3. Building Projects with Visual Studio MSBuild ........................................ 132
.........5.10.4. Building Projects with NAnt ................................................................ 133
.........5.10.5. Building Projects with Ruby and Ruby on Rails ....................................... 134
......5.11. Conclusion .................................................................................................. 136
...6. Automated Testing ................................................................................................... 137
......6.1. Introduction .................................................................................................. 137
......6.2. Automating Your Unit and Integration Tests ....................................................... 138
......6.3. Configuring Test Reports in Jenkins .................................................................. 139
......6.4. Displaying Test Results .................................................................................. 141
......6.5. Ignoring Tests ............................................................................................... 144
......6.6. Code Coverage .............................................................................................. 146
.........6.6.1. Measuring Code Coverage with Cobertura ............................................... 147
.........6.6.2. Measuring Code Coverage with Clover .................................................... 156
......6.7. Automated Acceptance Tests ........................................................................... 157
......6.8. Automated Performance Tests with JMeter ......................................................... 160
......6.9. Help! My Tests Are Too Slow! ........................................................................ 168
.........6.9.1. Add More Hardware ............................................................................ 168
.........6.9.2. Run Fewer Integration/Functional Tests ................................................... 169
.........6.9.3. Run Your Tests in Parallel .................................................................... 169
......6.10. Conclusion .................................................................................................. 170
...7. Securing Jenkins ...................................................................................................... 171
......7.1. Introduction .................................................................................................. 171
......7.2. Activating Security in Jenkins .......................................................................... 171
......7.3. Simple Security in Jenkins .............................................................................. 172
......7.4. Security Realms—Identifying Jenkins Users ....................................................... 173
.........7.4.1. Using Jenkins’s Built-in User Database ................................................... 173
.........7.4.2. Using an LDAP Repository ................................................................... 176
.........7.4.3. Using Microsoft Active Directory ........................................................... 178
.........7.4.4. Using Unix Users and Groups ............................................................... 179
.........7.4.5. Delegating to the Servlet Container ......................................................... 179
.........7.4.6. Using Atlassian Crowd ......................................................................... 180
.........7.4.7. Integrating with Other Systems .............................................................. 181
......7.5. Authorization—Who Can Do What ................................................................... 183
.........7.5.1. Matrix-based Security .......................................................................... 183
.........7.5.2. Project-based Security .......................................................................... 187
.........7.5.3. Role-based Security ............................................................................. 189
......7.6. Auditing—Keeping Track of User Actions ......................................................... 191
......7.7. Conclusion ................................................................................................... 194
...8. Notification ............................................................................................................. 197
......8.1. Introduction .................................................................................................. 197
......8.2. Email Notification .......................................................................................... 197
......8.3. More Advanced Email Notification ................................................................... 198
......8.4. Claiming Builds ............................................................................................ 202
......8.5. RSS Feeds .................................................................................................... 203
......8.6. Build Radiators ............................................................................................. 204
......8.7. Instant Messaging .......................................................................................... 206
.........8.7.1. IM Notification with Jabber .................................................................. 206
.........8.7.2. IM Notification using IRC .................................................................... 210
......8.8. IRC Notification ............................................................................................ 211
......8.9. Desktop Notifiers ........................................................................................... 214
......8.10. Notification via Notifo .................................................................................. 217
......8.11. Mobile Notification ...................................................................................... 219
......8.12. SMS Notification ......................................................................................... 220
......8.13. Making Noise .............................................................................................. 222
......8.14. Extreme Feedback Devices ............................................................................ 224
......8.15. Conclusion .................................................................................................. 226
...9. Code Quality ........................................................................................................... 227
......9.1. Introduction .................................................................................................. 227
......9.2. Code Quality in Your Build Process .................................................................. 228
......9.3. Popular Java and Groovy Code Quality Analysis Tools ......................................... 229
.........9.3.1. Checkstyle ......................................................................................... 229
.........9.3.2. PMD/CPD .......................................................................................... 232
.........9.3.3. FindBugs ........................................................................................... 236
.........9.3.4. CodeNarc ........................................................................................... 238
......9.4.ReportingonCodeQualityIssueswiththeViolationsPlugin................................. 239
.........9.4.1. Working with Freestyle Build Jobs ......................................................... 240
.........9.4.2. Working with Maven Build Jobs ............................................................ 243
......9.5. Using the Checkstyle, PMD, and FindBugs Reports ............................................. 245
......9.6. Reporting on Code Complexity ........................................................................ 248
......9.7. Reporting on Open Tasks ................................................................................ 249
......9.8. Integrating with Sonar .................................................................................... 251
......9.9. Conclusion ................................................................................................... 255
...10. Advanced Builds .................................................................................................... 257
......10.1. Introduction ................................................................................................. 257
......10.2. Parameterized Build Jobs ............................................................................... 257
.........10.2.1. Creating a Parameterized Build Job ....................................................... 257
.........10.2.2. Adapting Your Builds to Work with Parameterized Build Scripts ................. 259
.........10.2.3. More Advanced Parameter Types ......................................................... 261
.........10.2.4. Building from a Subversion Tag ........................................................... 262
.........10.2.5. Building from a Git Tag ..................................................................... 263
.........10.2.6. Starting a Parameterized Build Job Remotely .......................................... 264
.........10.2.7. Parameterized Build Job History ........................................................... 265
......10.3. Parameterized Triggers .................................................................................. 265
......10.4. Multiconfiguration Build Jobs ........................................................................ 268
.........10.4.1. Setting Up a Multiconfiguration Build ................................................... 268
.........10.4.2. Configuring a Slave Axis .................................................................... 269
.........10.4.3. Configuring a JDK Axis ..................................................................... 270
.........10.4.4. Custom Axis ..................................................................................... 271
.........10.4.5. Running a Multiconfiguration Build ...................................................... 271
......10.5. Generating Your Maven Build Jobs Automatically ............................................. 274
.........10.5.1. Configuring a Job .............................................................................. 275
.........10.5.2. Reusing Job Configuration with Inheritance ............................................ 277
.........10.5.3. Plugin Support .................................................................................. 278
.........10.5.4. Freestyle Jobs ................................................................................... 281
......10.6. Coordinating Your Builds .............................................................................. 281
.........10.6.1. Parallel Builds in Jenkins .................................................................... 282
.........10.6.2. Dependency Graphs ........................................................................... 282
.........10.6.3. Joins ................................................................................................ 283
.........10.6.4. Locks and Latches ............................................................................. 284
......10.7. Build Pipelines and Promotions ...................................................................... 285
.........10.7.1. Managing Maven Releases with the M2Release Plugin .............................. 286
.........10.7.2. Copying Artifacts .............................................................................. 289
.........10.7.3. Build Promotions ............................................................................... 292
.........10.7.4. Aggregating Test Results .................................................................... 300
.........10.7.5. Build Pipelines .................................................................................. 301
......10.8. Conclusion .................................................................................................. 304
...11. Distributed Builds ................................................................................................... 305
......11.1. Introduction ................................................................................................. 305
......11.2. The Jenkins Distributed Build Architecture ....................................................... 305
......11.3. Master/Slave Strategies in Jenkins ................................................................... 306
.........11.3.1. The Master Starts the Slave Agent Using SSH .........................................306
.........11.3.2.StartingtheSlaveAgentManuallyUsingJavaWebStart.......................... 310
.........11.3.3. Installing a Jenkins Slave as a Windows Service ...................................... 313
.........11.3.4. Starting the Slave Node in Headless Mode ............................................. 314
.........11.3.5. Starting a Windows Slave as a Remote Service ........................................ 315
......11.4. Associating a Build Job with a Slave or Group of Slaves ..................................... 315
......11.5. Node Monitoring .......................................................................................... 317
......11.6. Cloud Computing ......................................................................................... 318
.........11.6.1. Using Amazon EC2 ........................................................................... 318
......11.7. Using the CloudBees DEV@cloud Service ....................................................... 322
......11.8. Conclusion .................................................................................................. 323
...12. Automated Deployment and Continuous Delivery ......................................................... 325
......12.1. Introduction ................................................................................................. 325
......12.2. Implementing Automated and Continuous Deployment ........................................ 326
.........12.2.1. The Deployment Script ....................................................................... 326
.........12.2.2. Database Updates .............................................................................. 326
.........12.2.3. Smoke Tests ..................................................................................... 329
.........12.2.4. Rolling Back Changes ........................................................................ 329
......12.3. Deploying to an Application Server ................................................................. 330
.........12.3.1. Deploying a Java Application .............................................................. 330
.........12.3.2. Deploying Scripting-based Applications Like Ruby and PHP ...................... 339
......12.4. Conclusion .................................................................................................. 342
...13. Maintaining Jenkins ................................................................................................ 345
......13.1. Introduction ................................................................................................. 345
......13.2. Monitoring Disk Space .................................................................................. 345
.........13.2.1. Using the Disk Usage Plugin ............................................................... 346
.........13.2.2. Disk Usage and the Jenkins Maven Project Type ..................................... 348
......13.3. Monitoring the Server Load ........................................................................... 349
......13.4. Backing Up Your Configuration ..................................................................... 351
.........13.4.1. Fundamentals of Jenkins Backups ......................................................... 351
.........13.4.2. Using the Backup Plugin ..................................................................... 353
.........13.4.3. More Lightweight Automated Backups .................................................. 354
......13.5. Archiving Build Jobs .................................................................................... 355
......13.6. Migrating Build Jobs .................................................................................... 356
......13.7. Conclusion .................................................................................................. 359
A. Automating Your Unit and Integration Tests ................................................................ 361
...A.1. Automating Your Tests with Maven ................................................................. 361
...A.2. Automating Your Tests with Ant ..................................................................... 366
Index ......................................................................................................................... 371
· · · · · · (收起)

讀後感

評分

书是11年出的,翻译的时间是16,差了5年,Jenkins最新的版本是2.46,而书上用的是1.xx http://mirrors.jenkins.io/war-stable/ 。。。我下的是最新的版本,照着书上的示例,有多地方有很大的区别。关于Jenkins的中文资料确实有点少,而且都有点老了。在操作的过程中遇到了很多坑。

評分

书是11年出的,翻译的时间是16,差了5年,Jenkins最新的版本是2.46,而书上用的是1.xx http://mirrors.jenkins.io/war-stable/ 。。。我下的是最新的版本,照着书上的示例,有多地方有很大的区别。关于Jenkins的中文资料确实有点少,而且都有点老了。在操作的过程中遇到了很多坑。

評分

《Jenkins权威指南》从实践者的角度,在讲解Jenkins基本原理的同时,深入到持续集成、持续交付领域,为读者梳理出如何使用Jenkins设计和实现一个自动化的、周期性的集成测试过程,帮助读者理解Jenkins适用于什么场景。《Jenkins权威指南》中首先介绍Jenkins以及持续集成、持续...  

評分

1、Jenkins的启动参数: java -jar jenkins.war --httpPort=8081 java -jar jenkins.war --httpPort=8081 --ajp13Port=8010 远程构建触发: Jenkins +svn Jenkins +git 远程触发构建 MAVEN ANT shell Windows shell 系统变量:BUILD_NUMBER BUILD_ID JOB_NAME BUILD_TAG JAVA_H...  

評分

1、Jenkins的启动参数: java -jar jenkins.war --httpPort=8081 java -jar jenkins.war --httpPort=8081 --ajp13Port=8010 远程构建触发: Jenkins +svn Jenkins +git 远程触发构建 MAVEN ANT shell Windows shell 系统变量:BUILD_NUMBER BUILD_ID JOB_NAME BUILD_TAG JAVA_H...  

用戶評價

评分

我給它寫瞭個plugin...老闆笑瞭真是醉瞭...

评分

最近在搞基於Jenkins的持續交付,看工具書的好處就是能找到一些最佳實踐,少走些彎路。

评分

Jenkins聖經

评分

齣說中的持續集成哦

评分

Jenkins聖經

本站所有內容均為互聯網搜索引擎提供的公開搜索信息,本站不存儲任何數據與內容,任何內容與數據均與本站無關,如有需要請聯繫相關搜索引擎包括但不限於百度google,bing,sogou

© 2025 book.quotespace.org All Rights Reserved. 小美書屋 版权所有