Cloud Native 10 min read

Implementing a TFS + Jenkins CI/CD Solution on a PaaS Platform with OpenShift

This article describes how to build a CI/CD pipeline using TFS for source control and Jenkins for automation on a Red Hat OpenShift‑based PaaS, covering code management, automated builds, testing, container image creation, deployment, and the necessary Jenkins and TFS configurations.

DevOps
DevOps
DevOps
Implementing a TFS + Jenkins CI/CD Solution on a PaaS Platform with OpenShift

In the context of rapid internet development, businesses need to shorten software development cycles, and CI/CD has become a key method for achieving fast, reliable delivery.

CI/CD is presented as a factory‑like software engineering practice that typically includes code management, automated build, automated deployment, and build‑verification testing.

Code Management – All source files should be stored in a version‑control system (e.g., SVN, Git, FireFly) to enable history tracking and role‑based access control.

Automated Build – When code changes or on a schedule, a build tool (e.g., Maven, Ant) converts source code into deployable packages.

Build Verification Tests – Unit tests (e.g., JUnit) and functional tests (e.g., ATP) are run automatically to ensure quality.

The article then introduces a PaaS‑based CI/CD practice built on Red Hat OpenShift, using TFS as the source repository and Jenkins containerized on the PaaS.

Jenkins Deployment – Jenkins runs in a master‑slave architecture, with the master providing a web UI and slaves executing builds. Both master and slaves are deployed as containers on OpenShift, and slaves are created dynamically via OpenShift templates.

TFS Configuration – TFS is set up to trigger Jenkins, perform code compliance and security checks, and store build logs. Steps include configuring compliance checks, linking Jenkins credentials, and defining trigger methods.

Jenkins Configuration – Includes setting the Jenkins agent image, creating a List View, defining a Pipeline job, and assigning project permissions through the global security matrix.

Pipeline Configuration – Credentials for TFS access are added in Jenkins. The pipeline script (shown below) defines stages for compiling, unit testing, packaging, image building, and deployment to the DEV environment.

def app_name = '应用名称'
def service_name = "${app_name}"
def dev_project_name = '应用在ocp中所在的project'

def base_image = '基础镜像名称'
def tfs_credentialsId = 'CredentialID'
def tfs_url = '代码库URL'
def tfs_branch = "TFS Git代码库分支名"
def tfs_tag = "TFS Git代码库标签"
def version, mvnCmd = 'mvn '

pipeline {
    agent {
        label 'maven'
    }
    stages {
        stage('Compile Package') {
        steps {
            //下载应用代码
        }
    }
    stage('Unit Test') {
        steps {
           //进行单元测试
        }
    }
    stage('Build Package') {
        steps {
            //构建应用部署包
        }
    }
    stage('Create Image Builder') {
     steps {
          //配置构建镜像信息
            }
        }
        stage('Build Image') {
            steps {
              //构建应用镜像
            }
        }
        stage('Deploy DEV') {
            steps {
//部署应用镜像
}
        }
  }

To execute the pipeline, the user logs into Jenkins, selects the created pipeline, and clicks “Build Now”, then monitors the console output for detailed logs.

Summary – CI/CD is a cornerstone of agile development, offering automation, continuous delivery, reduced manual errors, and faster iteration, while the PaaS‑based solution simplifies environment setup and accelerates product releases.

CI/CDDevOpsPipelinePaaSJenkinsOpenShiftTFS
DevOps
Written by

DevOps

Share premium content and events on trends, applications, and practices in development efficiency, AI and related technologies. The IDCF International DevOps Coach Federation trains end‑to‑end development‑efficiency talent, linking high‑performance organizations and individuals to achieve excellence.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.