How to Set Up a CI/CD Pipeline with IBM Rational Team Concert (RTC) and Jenkins on Red Hat Linux

IBM Rational Team Concert (RTC) is a collaborative lifecycle management tool for version control and agile project management. Jenkins is a leading CI/CD tool for automating software builds and deployments. Together, they streamline development workflows, improve efficiency, and reduce manual errors in organizations.

This tutorial will guide you through integrating IBM Rational Team Concert (RTC) with Jenkins to automate builds and deployments in a CI/CD pipeline.


Prerequisites

Before you begin, ensure you have the following:

  • IBM Rational Team Concert (RTC) server installed and configured.
  • Jenkins installed on a Red Hat Linux machine.
  • Git or RTC SCM Command Line Tool installed for source code management.
  • A Jenkins User with admin rights to manage plugins and jobs.
  • Basic familiarity with RTC, Jenkins, and Red Hat Linux commands.

Step 1: Install and Configure Jenkins

Goal: Set up Jenkins on your Red Hat Linux system to manage and automate build jobs.

  1. Install Jenkins:

    sudo yum install java-11-openjdk-devel -y
    sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
    sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
    sudo yum install jenkins -y
    
  2. Start Jenkins:

    sudo systemctl start jenkins
    sudo systemctl enable jenkins
    
  3. Access Jenkins:
    Open a browser and go to http://<your-server-ip>:8080. Follow the instructions to unlock Jenkins using the password from:

    sudo cat /var/lib/jenkins/secrets/initialAdminPassword
    
  4. Install Required Plugins:

    • Log in to Jenkins.
    • Navigate to Manage Jenkins > Manage Plugins.
    • Install the following plugins:
      • RTC Plugin
      • Git Plugin
      • Pipeline Plugin

Step 2: Configure RTC for Jenkins Integration

Goal: Create a build definition and engine in RTC to enable integration with Jenkins.

  1. Create a Build Definition in RTC:

    • Open the RTC Eclipse Client.
    • Navigate to your project area and create a new build definition (File > New > Build Definition).
    • Choose Jenkins as the build engine type.
    • Configure the source control settings:
      • Specify the RTC repository workspace or stream to use.
  2. Create a Build Engine in RTC:

    • In the same project area, create a build engine linked to your build definition.
    • Specify the Jenkins URL: http://<your-server-ip>:8080.

Step 3: Configure Jenkins Job

Goal: Set up a Jenkins job to pull code from RTC, build it, and archive the artifacts.

  1. Create a New Job:

    • In Jenkins, click New Item and select Freestyle Project.
    • Name your job (e.g., RTC-Build).
  2. Link Jenkins to RTC:

    • In the job configuration, go to the Source Code Management section.
    • Choose RTC and provide the following:
      • RTC Server URL
      • Repository Workspace or Stream
      • RTC credentials (username and password).
  3. Define the Build Step:

    • Add a build step to execute a shell script:
      #!/bin/bash
      # Example build commands
      echo "Starting build from RTC..."
      # Compile the code (e.g., Maven/Gradle/Ant)
      mvn clean install
      
  4. Post-Build Actions:

    • Add an action to archive the build artifacts:
      • Specify files to archive (e.g., target/*.jar).

Step 4: Test the Pipeline

Goal: Validate the integration by triggering a build and verifying the results.

  1. Trigger the Build:

    • Go to the Jenkins job page and click Build Now.
    • Verify the build process by checking the Console Output.
  2. Automate Triggering:

    • In RTC, configure the build definition to trigger builds automatically based on changesets.
    • Enable polling or event-based triggers in Jenkins.

Step 5: Monitor and Extend the Pipeline

Goal: Use Jenkins to monitor pipeline performance and add more stages for testing or deployment.

  • Monitor Builds:

    • Use the Jenkins Dashboard to monitor build statuses.
    • View detailed logs and trends.
  • Extend the Pipeline:

    • Add stages for testing and deployment using the Pipeline plugin.
    • Integrate other tools like SonarQube for code quality checks.

Troubleshooting Tips

  • Permission Errors:
    Ensure the Jenkins user has appropriate permissions to access RTC and execute builds.

  • Build Fails Due to SCM:
    Double-check repository workspace or stream configurations in the RTC plugin settings.

  • Jenkins Service Not Starting:
    Verify that Java is correctly installed:

    java -version
    

Conclusion

You’ve successfully set up a basic CI/CD pipeline integrating IBM Rational Team Concert (RTC) with Jenkins on Red Hat Linux. This setup automates your builds, saving time and reducing manual errors. Enhance your pipeline further by adding stages for automated testing, deployment, and monitoring.