Compare commits
4 Commits
ansible-in
...
main
| Author | SHA1 | Date |
|---|---|---|
|
|
1e8e7bcddf | |
|
|
083d6eb455 | |
|
|
e57d4fb27b | |
|
|
5bd30a70f1 |
|
|
@ -83,7 +83,7 @@ tool:
|
|||
|
||||
jobs:
|
||||
- script: >
|
||||
SEEDING_BRANCH = 'ansible-instance'
|
||||
SEEDING_BRANCH = 'main'
|
||||
|
||||
freeStyleJob('Seed Job') {
|
||||
scm {
|
||||
|
|
@ -99,7 +99,7 @@ jobs:
|
|||
}
|
||||
}
|
||||
parameters {
|
||||
stringParam('SEEDING_BRANCH', 'ansible-instance', "The branch to seed the jobs from, e.g. develop or main")
|
||||
stringParam('SEEDING_BRANCH', 'main', "The branch to seed the jobs from, e.g. develop or main")
|
||||
}
|
||||
steps {
|
||||
shell('git checkout $SEEDING_BRANCH')
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ env.HASHSERVER = "${env.HASH_SSTATE_SRV_IP}:8686"
|
|||
env.YOCTO_REPO_DIR = "nwl"
|
||||
env.YOCTO_RELEASE = 'kirkstone'
|
||||
|
||||
env.CI_IMAGE = "nwl-ramdisk-minimal"
|
||||
env.CI_IMAGE = "nwl-test-image"
|
||||
|
||||
|
||||
// Artifactory
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ pipelineJob('nwl') {
|
|||
}
|
||||
}
|
||||
remote {
|
||||
credentials('gitCredentials')
|
||||
credentials('nmgit_credentials')
|
||||
url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git')
|
||||
}
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ pipelineJob('nwl-target') {
|
|||
}
|
||||
}
|
||||
remote {
|
||||
credentials('gitCredentials')
|
||||
credentials('nmgit_credentials')
|
||||
url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git')
|
||||
}
|
||||
}
|
||||
|
|
@ -79,6 +79,7 @@ pipelineJob('nwl-target') {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
pipelineJob('nwl-update-src-rev') {
|
||||
def branchToUse = binding.variables.get("SEEDING_BRANCH")
|
||||
|
||||
|
|
@ -105,7 +106,7 @@ pipelineJob('nwl-update-src-rev') {
|
|||
}
|
||||
}
|
||||
remote {
|
||||
credentials('gitCredentials')
|
||||
credentials('nmgit_credentials')
|
||||
url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git')
|
||||
}
|
||||
}
|
||||
|
|
@ -114,42 +115,3 @@ pipelineJob('nwl-update-src-rev') {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pipelineJob('doc') {
|
||||
def branchToUse = binding.variables.get("SEEDING_BRANCH")
|
||||
|
||||
displayName('Documentation')
|
||||
description('Builds the Documentation of the work concerning NWL CI')
|
||||
authorization {
|
||||
permissionAll('anonymous')
|
||||
}
|
||||
authenticationToken('buildDocToken')
|
||||
logRotator {
|
||||
artifactDaysToKeep(7)
|
||||
artifactNumToKeep(7)
|
||||
daysToKeep(7)
|
||||
numToKeep(7)
|
||||
}
|
||||
properties {
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
definition {
|
||||
cpsScm {
|
||||
scm {
|
||||
git {
|
||||
branches(branchToUse)
|
||||
extensions {
|
||||
cloneOptions {
|
||||
depth(1)
|
||||
}
|
||||
}
|
||||
remote {
|
||||
credentials('gitCredentials')
|
||||
url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git')
|
||||
}
|
||||
}
|
||||
scriptPath('jobs/Jenkinsfile_Documentation')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,18 +91,6 @@ def updateTheSourceRevisions(commonHelpers, repoDir, theBranch) {
|
|||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
def setupNewBranchAndGetGitPushPostfix(theNewBranch) {
|
||||
if(sh(returnStatus: true, script: "git checkout ${theNewBranch}") == 0) {
|
||||
println "----------------------------------------------------\n\
|
||||
NOTE: Branch ${theNewBranch} already available \n\
|
||||
and potentially as well a pull/merge request.\n\
|
||||
--> handle this branch and request first\n----------------------------------------------------"
|
||||
error("Available branch ${theNewBranch} detected --> handle this first")
|
||||
}
|
||||
|
||||
sh(script: "git checkout -b ${theNewBranch}")
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
def createPR(theBranch) {
|
||||
def prReviewer = "bard"
|
||||
def prProject = "NM-NSP"
|
||||
|
|
@ -129,6 +117,12 @@ def createPR(theBranch) {
|
|||
--header '${acceptHeader}' \
|
||||
--header '${contentHeader}' \
|
||||
--data '${prDataJson}'").toString()
|
||||
|
||||
|
||||
// It is okay if the pull request already exists: we can ignore the error
|
||||
if(prResponse.contains("DuplicatePullRequestException"))
|
||||
return
|
||||
|
||||
if(prResponse.contains("error")) {
|
||||
error("Failed creating PR/MR:\n${prResponse}")
|
||||
}
|
||||
|
|
@ -151,7 +145,6 @@ def commitAndPushTheChanges(commonHelpers, repoDir, origBranch) {
|
|||
}
|
||||
else {
|
||||
def theCredentials = commonHelpers.getGitCredentialID()
|
||||
setupNewBranchAndGetGitPushPostfix("${nightlyBranch}")
|
||||
println "Commit and Push changes; message = '${commitMsg}'\nchanges = ${changedItems}"
|
||||
sshagent (credentials: [theCredentials]) {
|
||||
// ToDo: replace the user.email and user.name once a CI user is setup in the
|
||||
|
|
@ -159,8 +152,9 @@ def commitAndPushTheChanges(commonHelpers, repoDir, origBranch) {
|
|||
sh(label: "Commit and push changes", returnStdout: true, script: """
|
||||
git config --global user.email "marc.mattmueller@netmodule.com"
|
||||
git config --global user.name "Marc Mattm\u00fcller"
|
||||
git checkout -B ${nightlyBranch}
|
||||
git commit -m "${commitMsg}"
|
||||
git push -u origin ${nightlyBranch}
|
||||
git push --force --set-upstream origin ${nightlyBranch}
|
||||
""")
|
||||
}
|
||||
usedBranch = "${nightlyBranch}"
|
||||
|
|
|
|||
|
|
@ -9,3 +9,4 @@ netmodule-hw22
|
|||
netmodule-hw24
|
||||
netmodule-hw25
|
||||
netmodule-hw26
|
||||
netmodule-hw34
|
||||
|
|
|
|||
Loading…
Reference in New Issue