Learning Continuous Integration with TeamCity

Book Description

Master the principles and practices behind Continuous Integration by setting it up for different technology stacks using TeamCity

In Detail

For those of you getting started with CI, TeamCity, or both, this book will help you understand the principles and essential practices of CI and then provide steps to implement them in different kinds of projects. The book covers the essential features of TeamCity that are needed for a complete CI setup.

You will cover everything from introducing CI to its practises and benefits before getting started with TeamCity as a CI tool. First, we set up CI in a tech stack agnostic way, and then employ CI for different platforms and stacks. Throughout, there is a continuous progression from the simple to the most advanced features of TeamCity, with advise on how to avoid the pitfalls too.

You will also be given an introduction to what's beyond CI - Continuous Delivery and Continuous Deployment - and how TeamCity can help you there too.

What You Will Learn

  • Understand Continuous Integration principles and practices
  • Implement the build/deployment pipeline
  • Get to know TeamCity's features from the simple to the very advanced
  • Implement CI for projects in the major tech stacks, including Java, .NET, Ruby, Python, Android, and iOS
  • Discover which TeamCity features to avoid and in which situations
  • Look beyond CI into Continuous Delivery and Continuous Deployment

Publisher Resources

Download Example Code

Table of Contents

  1. Learning Continuous Integration with TeamCity
    1. Table of Contents
    2. Learning Continuous Integration with TeamCity
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Introduction
      1. Introduction to Continuous Integration
        1. Practices
        2. Benefits
        3. Continuous deployment and Continuous Delivery
        4. The build pipeline
      2. Introduction to TeamCity
        1. Licensing
        2. Features
          1. First-class support for various technologies
          2. Lots of plugins
          3. REST API
          4. Comprehensive VCS support
          5. A nice dashboard UI and build history
          6. Ease of setup and comprehensive documentation
          7. Build pipeline/chains
          8. Agents and build grids
          9. IDE integrations
      3. TeamCity and its competitors
        1. Jenkins
        2. ThoughtWorks' Go
      4. Summary
    9. 2. Installation
      1. Installing on Windows
        1. Installing the server and the default agent
        2. Installing additional agents
      2. Installation on Mac OS X
        1. Running the TeamCity server and the default agent
        2. Setting up the TeamCity server as a daemon
        3. Installing additional agents
      3. Installation on Linux
        1. Running the server and the default agent
        2. Running the TeamCity server as a daemon
        3. Installing additional agents
      4. Summary
    10. 3. Getting Your CI Up and Running
      1. Introducing version control systems
        1. Centralized versus distributed VCSs
        2. VCSs and CI
        3. VCS used in this book
      2. Setting up CI
        1. The sample project
        2. Creating a project in TeamCity
          1. Subprojects
        3. Adding build configurations
          1. VCS roots and VCS settings
          2. Introducing the build steps
          3. Running our first build
          4. Build failure conditions
          5. Triggering the build on VCS changes
        4. Build chains
          1. Deploying to Heroku
          2. Adding functional tests
            1. Parameters and build parameters
          3. Setting up the build chain
            1. Snapshot dependencies
            2. The Finish build trigger
            3. The Build chain view
        5. Fine-tuning our setup
          1. Adding coverage and unit test reports
            1. Publishing reports as artifacts
            2. XML report processing
            3. Report tabs
            4. Build and project statistics
            5. Shared resources
            6. Agent Requirements
      3. Summary
    11. 4. TeamCity for Java Projects
      1. Using Ant with TeamCity
        1. Installing Ant
        2. Building with Ant build files
          1. Building with Ant in a build configuration
        3. Adding some unit tests
        4. Setting up code coverage
        5. Build scripts versus TeamCity features
        6. System properties and Ant
      2. Using Maven with TeamCity
        1. Installing Maven
        2. Creating a Maven project
        3. Introducing the Project Object Model (POM)
        4. Building the project
        5. Using Maven in a build configuration
        6. Setting version number
        7. Setting up code coverage for our build
        8. Maven on TeamCity, beyond the build runner
          1. Creating a Maven build configuration
          2. Global Maven settings file
          3. Setting up Maven-based triggers
      3. Using Gradle with TeamCity
        1. Installing Gradle
        2. Building with Gradle on TeamCity
      4. Introducing database migration tools
      5. Summary
    12. 5. TeamCity for .NET Projects
      1. Getting started with NAnt on TeamCity
        1. Installing NAnt
        2. Building NAnt with NAnt
        3. Building on TeamCity
          1. Adding NUnit report processing
          2. Configuring agent requirements
      2. Building with MSBuild
        1. Installing MSBuild
        2. Starting an MSBuild project
        3. Building with MSBuild on TeamCity
        4. Adding an NUnit build runner
        5. Running NUnit tests using NUnit task
        6. Running NUnit tests using the task provided by TeamCity
        7. Configuring code coverage with MSBuild
      3. NuGet and TeamCity
        1. Installing the NuGet command-line client
        2. Installing NuGet.exe on TeamCity agents
        3. TeamCity as a NuGet server
        4. NuGet-based build runners
        5. NuGet dependency trigger
      4. Introducing PowerShell
        1. PowerShell-based build tools
        2. PowerShell build runner in TeamCity
      5. Database migrations with .NET
      6. Summary
    13. 6. TeamCity for Ruby Projects
      1. Getting started with Rails
        1. Managing Ruby versions
        2. Introducing Bundler
          1. Installing Rails using Bundler
        3. Introducing Rake
        4. Setting up the build on TeamCity
          1. Setting up Ruby interpreter
          2. Running Capybara- and Selenium-based feature tests
      2. Summary
    14. 7. TeamCity for Mobile and Other Technologies
      1. CI for Android projects
        1. Generating the APK
        2. Running Calabash tests
      2. Building iOS projects on TeamCity
      3. Installing TeamCity plugins
        1. Installing the Python runner plugin
        2. Building with the Python build runner
        3. Introduction to TeamCity.Node plugin
      4. Summary
    15. 8. Integration with Other Tools
      1. IDE integrations
        1. IntelliJ platform IDEs integration
          1. Installing the plugin
          2. Configuring notifications
          3. Managing projects from the IDE
          4. Opening files and patches in IDE
          5. Remote Run
        2. Visual Studio integrations
      2. GitHub integrations
        1. GitHub webhooks and services
        2. Using the TeamCity.GitHub plugin
        3. Support for pull requests
        4. Integrating with GitHub issue tracker
      3. Build monitors
        1. Team Piazza
        2. Project Monitor
        3. Build lights
      4. Notifications
      5. Summary
    16. 9. TeamCity for a Member of the Team
      1. Managing projects of interest
        1. Hiding projects
        2. Hiding build configurations
      2. Navigating across projects
      3. Investigating investigations
        1. Assigning investigations
        2. Viewing active investigations
        3. Managing current and muted problems
      4. TeamCity universal search
      5. Actions on build configurations
        1. Pausing triggers in a build configuration
        2. Checking for pending changes
        3. Enforcing clean checkout
      6. Summary
    17. 10. Taking It a Level Up
      1. Build configuration templates
        1. Creating templates from scratch
        2. Creating build configurations from the template
        3. Creating templates from existing build configurations
      2. Going meta with Meta-Runners
        1. Using Meta-Runners
      3. Build result actions
        1. Commenting on build results
        2. Tagging build results
        3. Pinning build results
        4. Promoting builds
        5. Marking the build as successful or failed
        6. Removing builds
      4. Build history cleanup
        1. Cleanup rules
        2. Archiving projects
      5. Configuring build priorities
      6. Interacting with TeamCity from build scripts
        1. Service messages
        2. Creating teamcity-info.xml
      7. Summary
    18. 11. Beyond CI – Continuous Delivery
      1. What is Continuous Delivery?
      2. Why Continuous Delivery?
      3. The deployment pipeline
      4. Implementing the deployment pipeline in TeamCity
        1. Publishing and consuming artifacts
        2. Build chain for CI
        3. Deploying to environments
        4. Environments as gates
        5. Identifying the build that is deployed in an environment
        6. Deploying any version to an environment
        7. Limiting deployment permissions to certain users
        8. Passing sensitive information during deployment
        9. Feature branching and feature toggling
      5. Summary
    19. 12. Making It Production Ready
      1. Using TeamCity with an external database
        1. Configuring PostgreSQL as an external database
        2. Migrating from one database to another
      2. Backup and restore
        1. Taking backups from the server UI
        2. Backing up and restoring data using the maintainDB tool
        3. A manual backup
      3. Handling upgrades
        1. Updating a server installed via an archive
        2. Updating TeamCity using the Windows installer
        3. Updating the agents
      4. Monitoring resource usage, performance, and logs
        1. Disk space usage
        2. TeamCity server diagnostics
      5. Tweaking the TeamCity JVM
      6. Summary
    20. Index

Product Information

  • Title: Learning Continuous Integration with TeamCity
  • Author(s):
  • Release date: August 2014
  • Publisher(s): Packt Publishing
  • ISBN: 9781849699518