Compare commits
22 Commits
main
...
ansible-in
| Author | SHA1 | Date |
|---|---|---|
|
|
c258d09eb5 | |
|
|
3d3ed9bf9e | |
|
|
e2bf5b4140 | |
|
|
348149f6b1 | |
|
|
cccc0538a0 | |
|
|
7a103e7eae | |
|
|
57873d15cd | |
|
|
1e739d0817 | |
|
|
717b4ed219 | |
|
|
4f92abff9c | |
|
|
1100d2da3a | |
|
|
baa0da13a2 | |
|
|
49fcf8f854 | |
|
|
0d1367c06f | |
|
|
ff7b28774a | |
|
|
d57b6804d6 | |
|
|
225319fe69 | |
|
|
957dc52132 | |
|
|
0a2a6685ea | |
|
|
22b6e0adc4 | |
|
|
1f425845ad | |
|
|
6eef9775a3 |
|
|
@ -83,7 +83,7 @@ tool:
|
|||
|
||||
jobs:
|
||||
- script: >
|
||||
SEEDING_BRANCH = 'main'
|
||||
SEEDING_BRANCH = 'ansible-instance'
|
||||
|
||||
freeStyleJob('Seed Job') {
|
||||
scm {
|
||||
|
|
@ -99,7 +99,7 @@ jobs:
|
|||
}
|
||||
}
|
||||
parameters {
|
||||
stringParam('SEEDING_BRANCH', 'main', "The branch to seed the jobs from, e.g. develop or main")
|
||||
stringParam('SEEDING_BRANCH', 'ansible-instance', "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-test-image"
|
||||
env.CI_IMAGE = "nwl-ramdisk-minimal"
|
||||
|
||||
|
||||
// Artifactory
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ pipelineJob('nwl') {
|
|||
}
|
||||
}
|
||||
remote {
|
||||
credentials('nmgit_credentials')
|
||||
credentials('gitCredentials')
|
||||
url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git')
|
||||
}
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ pipelineJob('nwl-target') {
|
|||
}
|
||||
}
|
||||
remote {
|
||||
credentials('nmgit_credentials')
|
||||
credentials('gitCredentials')
|
||||
url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git')
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +79,6 @@ pipelineJob('nwl-target') {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
pipelineJob('nwl-update-src-rev') {
|
||||
def branchToUse = binding.variables.get("SEEDING_BRANCH")
|
||||
|
||||
|
|
@ -106,7 +105,7 @@ pipelineJob('nwl-update-src-rev') {
|
|||
}
|
||||
}
|
||||
remote {
|
||||
credentials('nmgit_credentials')
|
||||
credentials('gitCredentials')
|
||||
url('ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git')
|
||||
}
|
||||
}
|
||||
|
|
@ -115,3 +114,42 @@ 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,6 +91,18 @@ 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"
|
||||
|
|
@ -117,12 +129,6 @@ 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}")
|
||||
}
|
||||
|
|
@ -145,6 +151,7 @@ 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
|
||||
|
|
@ -152,9 +159,8 @@ 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 --force --set-upstream origin ${nightlyBranch}
|
||||
git push -u origin ${nightlyBranch}
|
||||
""")
|
||||
}
|
||||
usedBranch = "${nightlyBranch}"
|
||||
|
|
|
|||
|
|
@ -9,4 +9,3 @@ netmodule-hw22
|
|||
netmodule-hw24
|
||||
netmodule-hw25
|
||||
netmodule-hw26
|
||||
netmodule-hw34
|
||||
|
|
|
|||
Loading…
Reference in New Issue