pipeline {
/**###################### Agents Config ######################**/
agent {
kubernetes {
inheritFrom "${PodName}"
}
}
options {
// This will checkout the changed repository that has triggered this pipeline to a sperate folder named "tmp_repository", to be used later in the build
checkoutToSubdirectory('tmp_repository')
buildDiscarder(logRotator(numToKeepStr: 'unlimited'))
}
/**###################### Stages ######################**/
stages {
/**###################### Gerrit Review Log ######################**/
stage('Init') {
steps {
script {
gerritReview message: "Build started: ${BUILD_URL}"
}
}
}
/**###################### Cloning Manifest Repository ######################**/
stage('Cloning Manifest Repo') {
steps { // Executes on JNLP, no specific container required
script {
echo "Cloning the Manifest repository: ${ManifestRepoName}"
// This will checkout the manifest repository into a folder under the same name as the repository
dir("${ManifestRepoName}") {
checkout([
$class: 'GitSCM',
branches:
[[name: "*/${ManifestBranch}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [[
$class: 'LocalBranch',
localBranch: '**'
],[
$class: 'CleanBeforeCheckout',
deleteUntrackedNestedRepositories: false
]],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: GitHTTPSCredentials, /*Netid credentials must be used instead of HTTPS tokens.*/
url: ManifestRepoUrl]]
])
}
}
}
}
}