Compare commits

..

4 Commits

Author SHA1 Message Date
Marc Mattmüller 1e8e7bcddf jobs/nwlTargets: added target for GEMINI (XG900)
Signed-off-by: Marc Mattmüller <marc.mattmueller@netmodule.com>
2023-11-21 14:49:14 +01:00
Alexandre Bard 083d6eb455 Jenkinsfile_common: Build test image
Now that the test image is supported by all platforms, we can set it
back as default.
2023-11-21 10:48:01 +01:00
Alexandre Bard e57d4fb27b jobs/UpdateSrcRevisions: Ignore errors when PR already exists 2023-10-04 10:41:05 +02:00
Alexandre Bard 5bd30a70f1 update-src-revision: Overwrite nightly branch
This branch is reserved for that and may not be merged every day.
We want to overwrite anyway everynight with the latest changes.
2023-09-27 17:30:52 +02:00
5 changed files with 16 additions and 59 deletions

View File

@ -83,7 +83,7 @@ tool:
jobs: jobs:
- script: > - script: >
SEEDING_BRANCH = 'ansible-instance' SEEDING_BRANCH = 'main'
freeStyleJob('Seed Job') { freeStyleJob('Seed Job') {
scm { scm {
@ -99,7 +99,7 @@ jobs:
} }
} }
parameters { 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 { steps {
shell('git checkout $SEEDING_BRANCH') shell('git checkout $SEEDING_BRANCH')

View File

@ -27,7 +27,7 @@ env.HASHSERVER = "${env.HASH_SSTATE_SRV_IP}:8686"
env.YOCTO_REPO_DIR = "nwl" env.YOCTO_REPO_DIR = "nwl"
env.YOCTO_RELEASE = 'kirkstone' env.YOCTO_RELEASE = 'kirkstone'
env.CI_IMAGE = "nwl-ramdisk-minimal" env.CI_IMAGE = "nwl-test-image"
// Artifactory // Artifactory

View File

@ -33,7 +33,7 @@ pipelineJob('nwl') {
} }
} }
remote { remote {
credentials('gitCredentials') credentials('nmgit_credentials')
url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git') url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git')
} }
} }
@ -69,7 +69,7 @@ pipelineJob('nwl-target') {
} }
} }
remote { remote {
credentials('gitCredentials') credentials('nmgit_credentials')
url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git') url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git')
} }
} }
@ -79,6 +79,7 @@ pipelineJob('nwl-target') {
} }
} }
pipelineJob('nwl-update-src-rev') { pipelineJob('nwl-update-src-rev') {
def branchToUse = binding.variables.get("SEEDING_BRANCH") def branchToUse = binding.variables.get("SEEDING_BRANCH")
@ -105,7 +106,7 @@ pipelineJob('nwl-update-src-rev') {
} }
} }
remote { remote {
credentials('gitCredentials') credentials('nmgit_credentials')
url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git') 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')
}
}
}
}

View File

@ -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 createPR(theBranch) {
def prReviewer = "bard" def prReviewer = "bard"
def prProject = "NM-NSP" def prProject = "NM-NSP"
@ -129,6 +117,12 @@ def createPR(theBranch) {
--header '${acceptHeader}' \ --header '${acceptHeader}' \
--header '${contentHeader}' \ --header '${contentHeader}' \
--data '${prDataJson}'").toString() --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")) { if(prResponse.contains("error")) {
error("Failed creating PR/MR:\n${prResponse}") error("Failed creating PR/MR:\n${prResponse}")
} }
@ -151,7 +145,6 @@ def commitAndPushTheChanges(commonHelpers, repoDir, origBranch) {
} }
else { else {
def theCredentials = commonHelpers.getGitCredentialID() def theCredentials = commonHelpers.getGitCredentialID()
setupNewBranchAndGetGitPushPostfix("${nightlyBranch}")
println "Commit and Push changes; message = '${commitMsg}'\nchanges = ${changedItems}" println "Commit and Push changes; message = '${commitMsg}'\nchanges = ${changedItems}"
sshagent (credentials: [theCredentials]) { sshagent (credentials: [theCredentials]) {
// ToDo: replace the user.email and user.name once a CI user is setup in the // 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: """ sh(label: "Commit and push changes", returnStdout: true, script: """
git config --global user.email "marc.mattmueller@netmodule.com" git config --global user.email "marc.mattmueller@netmodule.com"
git config --global user.name "Marc Mattm\u00fcller" git config --global user.name "Marc Mattm\u00fcller"
git checkout -B ${nightlyBranch}
git commit -m "${commitMsg}" git commit -m "${commitMsg}"
git push -u origin ${nightlyBranch} git push --force --set-upstream origin ${nightlyBranch}
""") """)
} }
usedBranch = "${nightlyBranch}" usedBranch = "${nightlyBranch}"

View File

@ -9,3 +9,4 @@ netmodule-hw22
netmodule-hw24 netmodule-hw24
netmodule-hw25 netmodule-hw25
netmodule-hw26 netmodule-hw26
netmodule-hw34