docker,jobs: adaption for using pipelines on AWX- and HAC instance

the git credential ID is different for the AWX instance, thus the
jobs are selected according the hostname.
additionally I reordered the seed jobs in nwl-cicd.yaml

Signed-off-by: Marc Mattmüller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmüller 2023-06-21 11:03:18 +02:00
parent 99bb204bd3
commit 9c939b2c29
3 changed files with 28 additions and 25 deletions

View File

@ -74,29 +74,6 @@ tool:
jobs:
- script: >
multibranchPipelineJob('doc') {
displayName('10. Documentation')
description('Builds the Documentation of the work concerning NWL CI')
factory {
workflowBranchProjectFactory {
scriptPath('jobs/Jenkinsfile_Documentation')
}
}
orphanedItemStrategy {
discardOldItems {
numToKeep(5)
}
}
branchSources {
git {
id('build-doc')
remote('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git')
credentialsId('gitCredentials')
includes('main develop release*')
}
}
}
multibranchPipelineJob('nwl-build-pipeline') {
displayName('1. NWL CI Pipeline')
description('CI pipeline for the NetModule Wireless Linux')
@ -119,3 +96,26 @@ jobs:
}
}
}
multibranchPipelineJob('doc') {
displayName('10. Documentation')
description('Builds the Documentation of the work concerning NWL CI')
factory {
workflowBranchProjectFactory {
scriptPath('jobs/Jenkinsfile_Documentation')
}
}
orphanedItemStrategy {
discardOldItems {
numToKeep(5)
}
}
branchSources {
git {
id('build-doc')
remote('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git')
credentialsId('gitCredentials')
includes('main develop release*')
}
}
}

View File

@ -12,10 +12,12 @@ def targetList
// the files. In the current case we use any agent.
node() {
def repoPreCloneDir = "repo-preclone"
def nodeHostname = sh(returnStdout: true, script: "hostname | cut -d '_' -f1").trim()
def cloneCredentials = ("${nodeHostname}" == "nwl") ? 'admin_credentials' : 'gitCredentials'
dir(repoPreCloneDir) {
// clone the repository to get the file with the target list
sshagent (credentials: ['admin_credentials']) {
sshagent (credentials: [cloneCredentials]) {
sh "git clone --depth 1 --branch ${env.BRANCH_NAME} ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git ."
}

View File

@ -51,7 +51,8 @@ def cleaningClonedRepoDir() {
//-----------------------------------------------------------------------------
def getGitCredentialID() {
return 'admin_credentials'
def serverHostname = sh(returnStdout: true, script: "hostname | cut -d '_' -f1").trim()
return ("${serverHostname}" == "nwl") ? 'admin_credentials' : 'gitCredentials'
}