You are previewing IBM Rational ClearCase, Ant, and CruiseControl: The Java Developers Guide to Accelerating and Automating the Build Process.
O'Reilly logo
IBM Rational ClearCase, Ant, and CruiseControl: The Java Developers Guide to Accelerating and Automating the Build Process

Book Description

Optimize your entire Java build and release process with ClearCase®, Ant, and CruiseControl

Better builds mean better software. Effective, regular build processes accelerate development and improve quality, helping you identify small problems early, before they grow complex and costly to fix. Now, there’s a step-by-step guide to creating Java build processes that are right for your organization. Leading build and release management expert Kevin Lee introduces best practices for integrating and using three exceptionally powerful and recognized industry standard tools: IBM Rational® ClearCase software configuration management system, the open source Ant build tool, and CruiseControl for automating continuous builds.

No previous build experience is necessary: Lee thoroughly explains everything from configuring SCM environments and defining build scripts through to release packaging and deployment. He offers solutions and techniques for both Base ClearCase and Unified Change Management (UCM)–IBM Rational’s best practice Software Configuration Management usage model. Key techniques are presented in real-world context, through a full-fledged three-tier application case study.

Whether you are a software developer, manager, or integrator, this book will help you create better builds–and reap the benefits in efficiency, traceability, quality, and speed.

Coverage includes

·     Ensuring that every build you create is complete, consistent, and reproducible

·     Configuring a ClearCase-controlled environment to support your development organization’s build and release process

·     Installing Ant and configuring it to build all of your project assets

·     Integrating Ant with ClearCase and effectively using them together

·     Installing CruiseControl and configuring it to schedule and automate different types of builds

·     Integrating CruiseControl with ClearCase to schedule builds and automate baselines and reports

·     Creating custom baseline and change request reports

·     Setting up automatic notification whenever build problems arise

·     Creating and packaging releasable, traceable builds with ClearCase and ClearQuest™

Table of Contents

  1. Copyright
    1. Dedication
  2. IBM Press
    1. Rational® Software Books
    2. On Demand Computing Books
    3. WebSphere® Books
    4. More Books From IBM Press
    5. DDB2® Books
  3. Preface
    1. Why This Book Came About
    2. The Purpose of This Book
    3. What This Book Covers
      1. Chapter 1, “Introduction to Software Build and Release Management”
      2. Chapter 2, “Tools of the Trade”
      3. Chapter 3, “Configuring Your SCM Environment”
      4. Chapter 4, “Defining Your Build and Release Scripts”
      5. Chapter 5, “Apache Ant Best Practices”
      6. Chapter 6, “Running Your Build Scripts”
      7. Chapter 7, “CruiseControl Best Practices”
      8. Chapter 8, “Baseline and Change Request Reports”
      9. Chapter 9, “Build Reporting and Auditing”
      10. Chapter 10, “The Art of Releasing”
      11. Chapter 11, “Release Packaging and Deployment”
      12. Chapter 12, “Putting It All Together”
      13. How to Read This Book
  4. Acknowledgments
  5. About the Author
  6. I. Overview
    1. 1. Introduction to Software Build and Release Management
      1. Software Build and Release Management
        1. What’s in a Name? Definitions
        2. How It All Comes Together: Process
        3. A Bit More on Software Build Management
        4. A Bit More on Software Release Management
      2. Challenges in Building and Releasing Software
        1. What Exactly Is It? Traceability and Completeness
        2. Let’s Go Again: Repeatability and Reliability
        3. Faster Than a Speeding Bullet: Agility and Speed
      3. An Integrated Build and Release Life-Cycle Solution
        1. Manage Your Configuration Before It Manages You
        2. Automate
        3. Putting It All Together
      4. The Sample Scenario
        1. Welcome to RationalBank
      5. Summary
  7. II. Environment
    1. 2. Tools of the Trade
      1. Aims of This Chapter
      2. The Software Build and Release Toolbox
        1. IBM Rational ClearCase
        2. IBM Rational ClearQuest
        3. Apache Ant
        4. CruiseControl
        5. JUnit
        6. Perl
        7. XML
        8. Other Build Tools
        9. What About My IDE?
      3. A Review of ClearCase Concepts
        1. ClearCase Fundamentals
          1. What Is a VOB?
          2. What Is an Element?
          3. What Is a View?
          4. What Is a Config Spec?
        2. Next Stop, UCM
          1. What Is a Project?
          2. What Are Components, Baselines, and Streams?
          3. What Are Activities?
      4. Summary
    2. 3. Configuring Your SCM Environment
      1. Aims of This Chapter
      2. The Build Tools Directory Structure
      3. Creating a Base ClearCase Build Tools Structure
        1. Create a Build Tools VOB
        2. Create a Build Tools View
        3. Create the Build Tools Directories
        4. Import the Build Tools
        5. Label the Build Tools
        6. Make the Build Tools Directory Available to Your Users
      4. Creating a UCM Build Tools Structure
        1. Create a UCM Project VOB
        2. Create a Build Tools VOB
        3. Create the Build Tools Components
        4. Create a Build Tools UCM Project
        5. Create a Build Tools View
        6. Import the Build Tools
        7. Baseline the Build Tools
        8. Make the Build Tools Available to Your Users
        9. Clean up the Temporary View
      5. Build and Release Baselining Strategies
        1. Applying Base ClearCase Build Labels and Attributes
        2. Applying UCM Baselines
      6. Build and Release Branching Strategies
        1. Active Development Line
        2. Release-Prep Line
        3. Promotion Line
      7. Build and Release Workspace Strategies
      8. Summary
  8. III. Definition
    1. 4. Defining Your Build and Release Scripts
      1. Aims of This Chapter
      2. First Steps with Ant
        1. Download and Install Ant
        2. Configure Eclipse to Use Your JavaTools Ant
        3. The Build File
        4. Build File Editing with Eclipse
        5. Define the Project
        6. Initialize Properties
        7. Define the CLASSPATH
        8. Create a Clean Environment
        9. Compile the Files
        10. Test the Compiled Code
        11. The Completed Build File
        12. Execute the Build File
        13. Build File Execution with Eclipse
        14. Debug Your Build Files
      3. Summary
    2. 5. Apache Ant Best Practices
      1. Aims of This Chapter
      2. Property Files
        1. The Configurable Build
        2. Automated Baseline Numbering
        3. Reusing Prebuilt Libraries
      3. Ant ClearCase Integration
        1. Downloading and Installing clearantlib
        2. Using the Library
      4. Project Support
        1. Cumulative Targets
        2. Reusable Routines
        3. Reusable Libraries
        4. Build File Chaining
        5. Conditional Execution
        6. Groovy Ant Scripting
        7. Build Script Documentation
      5. Summary
  9. IV. Execution
    1. 6. Running Your Build Scripts
      1. Aims of This Chapter
      2. First Steps with CruiseControl
        1. The Manual Approach
        2. The Automatic Approach
        3. Download and Install CruiseControl
        4. Create a Workspace
        5. Create a Project Build Environment
        6. Define the Project
        7. Define Properties
        8. Define Listeners
        9. Define Bootstrappers
        10. Define SourceControls: Check for Modifications
        11. Define Builders: Schedule the Build
        12. Merge Test Results
        13. Define Publishers
        14. The Completed config File
        15. Test the config File
      3. Summary
    2. 7. CruiseControl Best Practices
      1. Aims of This Chapter
      2. CruiseControl Build Results Web
        1. Download and Install Apache Tomcat
        2. Configure and Install the Build Results Web
        3. Test the Build Results Web
        4. Using the JMX Console
      3. CruiseControl ClearCase Integration
        1. Automating Labeling or Baselining
        2. Granular Source Code Checking
        3. ClearCase Build Label Plug-in
        4. Adding CruiseControl Shortcuts to the ClearCase Explorer
      4. Scheduling
        1. Continuous Integration Build
        2. Nightly Build
        3. Forced Nightly Build
        4. Fallback Build
        5. Index Build
        6. Mixed Build
        7. Dependent Build
      5. Publishing
        1. Automated Deployment
        2. Publishing Criteria
        3. Continuous Staging
        4. CruiseControl RSS Feed
      6. Summary
  10. V. Reporting
    1. 8. Baseline and Change Request Reports
      1. Aims of This Chapter
      2. Generating Base ClearCase Baseline Reports
        1. Using the ClearCase Command Line
        2. Using Perl
      3. Generating UCM Baseline Reports
        1. Using the ClearCase Command Line
        2. Using Perl
      4. Generating Change Request Reports
        1. Using Perl and the ClearQuest API
        2. Creating a Consolidated Change Request Report
      5. Generating an RSS Feed from ClearQuest Change Requests
        1. A Sample RSS Feed
        2. Creating the Perl Script
        3. Automating Report Creation Using Ant
        4. Subscribing to the Feed
        5. Automating Report Generation Using CruiseControl
        6. Further Customizations
      6. Summary
    2. 9. Build Reporting and Auditing
      1. Aims of This Chapter
      2. Reporting and XML
        1. Baseline Reports in XML
        2. An XML DTD for Baselines
      3. Generating XML Formatted ClearCase Baseline Reports
        1. Using clearantlib to Generate Label and Baseline Reports
        2. Creating an XSLT Stylesheet
      4. Extending CruiseControl by Modifying the Build Results Web
        1. Generating an XML Baseline Report
        2. Merging the XML Baseline Report into the CruiseControl Log
        3. Adding a ClearCase Tab to the CruiseControl Build Results Web
        4. Creating an XSLT Stylesheet
        5. Deploying the Modified Build Results Web
        6. Further Customizations
      5. ClearCase Build Auditing
        1. What Is a Derived Object?
        2. What Is a Configuration Record?
        3. Auditing Ant Builds with ClearCase
        4. Executing an Audited Build Using Eclipse
        5. Viewing a Configuration Record Using Eclipse
        6. Executing an Audited Build Using CruiseControl
      6. Summary
  11. VI. Release
    1. 10. The Art of Releasing
      1. Aims of This Chapter
      2. Foundations for the Release
        1. The Deployment Unit
        2. The Deployment Boundary
        3. The Deployment Life Cycle
        4. Deployment Roles
      3. Constructing a Release Build
        1. The Staging Process
        2. Automating Staging
      4. Constructing a Release Build Using Base ClearCase
        1. Create the Release Build Environment
        2. Implement Critical Changes and Fixes
        3. Execute the Release Build
        4. Stage the Release Build Outputs
        5. Reusing Staged Objects
      5. Constructing a Release Build Using UCM
        1. Create the Release Build Environment
        2. Implement Critical Changes and Fixes
        3. Execute the Release Build
        4. Stage the Release Build Outputs
        5. Reusing Staged Objects
      6. Assembling Staged Objects for Deployment
        1. Create a Deployment Component
        2. Create an Assembly Project
        3. Create the Deployment Unit
      7. Summary
    2. 11. Release Packaging and Deployment
      1. Aims of This Chapter
      2. Release Packaging
        1. Creating Manifest Files
        2. Creating Java Archives
        3. Creating Java Web and Enterprise Archives
        4. A Complete Package Target
      3. Automating the Deployment Process
        1. Introduction to Build and Deployment Tracking
        2. Install Build and Deployment Tracking
        3. Integrate CruiseControl with Build Tracking
        4. Customize the Deployment Environment
        5. Create the Deployment Unit File
        6. Execute the Deployment
      4. Release Deployment
        1. Locating the Files to Deploy
        2. Deploying to File Systems
        3. Deploying to Web Servers
        4. Deploying to Application Servers
        5. Interactive Deployment
      5. Summary
  12. VII. Conclusion
    1. 12. Putting It All Together
      1. Revisiting Software Build and Release Management
        1. The Last Word on Software Build Management
        2. The Last Word on Software Release Management
        3. Overcoming the Challenges
          1. Automation
          2. Responsibility
          3. Optimization
          4. Pragmatism
      2. Implementing Your Own Process and Environment
        1. Start with a Strong Base
        2. Automate Only What You Need To
        3. Find Your Project Rhythm
        4. Have Fun
      3. The Working Example Revisited
        1. The RationalBank Scenario
        2. The RationalBank SCM Environment
        3. The RationalBank Project Rhythm
        4. Definition of Build Scripts
        5. Execution of Build Scripts
        6. Reporting
        7. Releasing and Deployment
      4. Summary
  13. Glossary
  14. Bibliography