What is the best design approach to keeping the Jenkinsfile small (little 
build logic as possible)?

Having close to a hundred projects and several branches on each, then 
duplicating the pipeline logic within each Jenkinsfile would be a 
maintenance nightmare.

1)
I could put the Pipeline script within Jenkins Scriptler
def packageInformation = load 
'../../../scriptler/scripts/package-information.groovy'
packageInformation.init()
However I'm only able to access this on the master node

2)
I could have all the pipeline scripts within a jenkins-ci-scripts project 
in Git.
stage 'Init'
git url: 'ssh://[email protected]/tools/jenkins-ci-scripts.git'
stash includes: '**/*.groovy', name: 'scripts'

stage 'Checkout'
checkout scm
unstash scripts
def packageInformation = load 
'src/main/groovy/com/company/pipeline/package-information.groovy'
packageInformation.init()
I could then load the pipeline scripts from this stash. However I do not 
like having to duplicate even this much in all my different Jenkinsfile.

3)
We have a inhouse build tool installed on all build machines. This contains 
various build scripts, shell, python, ruby.


Example Jenkinsfile with little logic as possible
def branch = env.BUILD_BRANCH
def pipeline = load '/path/to/our/installed/build-pipeline.groovy'
parallel pipeline.nodes(branch)


My current Jenkins instance I comprised of Multi-configuration 
jobs/projects (a jenkins job/project for each release branch). Having aprox 
8 release branches for each of the 60 projects. I am moving over to 
Pipeline because of a complex workflow and because Multi-configuration does 
not support a Prebuild-step that I need.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/126d204a-f002-4838-a67e-96d02913f7df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to