Upon David request here's our Jenkinsfile example, it's not all files 
should be enough to give a good idea of my current setup.

Note (the email-ext email content stop working between 2.51 and 2.54 
Jenkins update, since the absolute path can not be found anymore, I may 
have to transfer the file back to the master node or something similar).


   - The concept is to have Jenkinsfile alone into it's own mercurial repos.
   - Then as sub repos (JenkinsBuildHelperScripts) I have many 
   template/helper scripts.
   - The LocalSettings.groovy only exist on each node if some 
   installation/properties are special on a particular node.

This is the basic idea, the build system is configured to take 2 parameter:

   - PIPELINE_REPOS
   - PIPELINE_BRANCH_NAME
   
the default value are set for mostly used script but can be change for 
testing or if a dev want to check it's own branch or want to compile with 
another compiler (VS2013, VS2015, VS2017 config branch exist for example)


   1. The master checkout the Jenkinsfile repos (along with it's sub repos 
   since this is a Mercurial behavior). 
   2. Kick in the appropriate node
   3. *stage('Init Node')* The node checkout Jenkinsfile sub repos again 
   into it's tmp (avoid double checkout into workspace) to get access to build 
   helper scripts (could have been transfer from master to node but checkout 
   is simpler to make sure I got everything). It also make sure the proper env 
   settings are used and it sellect the proper MSBuild/Qt version installed on 
   the node.
   4. *stage('Checkout') *The actual code checkout
   5. *stage('Clean')* clean up previous build
   6. *stage('Build')* launch msbuild compilation for the whole solution
   7. *stage('Build Unit Tests')* compile the unit tests (google C++ tests)
   8. *stage('Run Unit Tests') * I have a python script that help run every 
   .exe of unit test with ADmonitoring, then I collect the core dump and tests 
   results. I also rerun failed tests into html mode, where I can collect the 
   awaited/results comparaison of our tests function and I publish them so 
   user can see what is wrong (we do a lot of 3D, so WebGL with simple 
   geometry can be render with our tests output).
   9. *stage('Benchmark') *some of our tests output benchmarks, I also have 
   a script that convert the output and log the data between build so I can 
   monitor the algo performance between build.
   10. *stage('Qml Syntax Checker') * the Qml syntax checker, run qmlint on 
   each files (output is console parsed later since we can only do it once).
   11. *stage('Qml Inspection')* same inspect valid Qml structure, qmldir 
   entry
   12. *stage('VcxProj Inspection')* make sure a dev didn't forget some 
   Optimization into the code and other in house settings. This is the last 
   place where we concat the .txt for the rules and do a single console 
   parsing.
   13. *stage('Doxygen Generation')* we then generate the doxygen
   14. Send the email with templates based on the build results. This is 
   broken into 2.54 (was working into 2.51): Jelly file 
   
[c:/Jenkins/workspace/CAD_CPP/CAD_CPP_ContinuousBuild@tmp/email_template_file.jelly]
 
   was not found in $JENKINS_HOME/email-templates.

This is not perfect at all, but it give a good idea of what is possible for 
us. I haven't play with the declarative pipeline yet. 

What I wish I had:

   1. I would like to have stage that run no matter what (even if previous 
   stage failed)
   2. Easy to express which stage are linear and which can be done into 
   parallel (on same node)
   3. Multiple Console parsing per stage output (super slow since it have 
   to parse the whole output which is totally unnecessary.
   4. email-ext that can take the absolute path template on node again!
   5. Programming language that is 100% compatible with Groovy language so 
   we can test outside Jenkins our scripts. My best fallback is to develop 
   Python and use groovy only to launch those script which remove a lot of 
   pain  (predictable, testable, stand alone development...).




-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/11abcfed-5e2f-422e-b539-0c87007ec33a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: Jenkinsfile
Description: Binary data

error /^SCRIPT NOT FOUND: (?!external)/
info /^SCRIPT NOT FOUND: external/

warning /^Script file not listed into qmldir: (?!external)/
info /^Script file not listed into qmldir: external/

error /^Module not found: (?!(QtQuick|QtQml|BuildSystemTools))/
info /^Module not found: (QtQuick|QtQml|BuildSystemTools)/
error /^FI\s+ERROR/
warning /^FI\s+WARNING/
info /^FI\s+INFO/

Attachment: PipelineXUnitTests.template
Description: Binary data

Attachment: PipelineArtifacts.template
Description: Binary data

Attachment: PipelineFooter.template
Description: Binary data

Attachment: PipelineHeader.template
Description: Binary data

Attachment: BcadFunctions.groovy
Description: Binary data

Attachment: JenkinsBuildVariables.groovy
Description: Binary data

Attachment: JenkinsEmailVariables.groovy
Description: Binary data

Attachment: LocalSettings.groovy
Description: Binary data

Reply via email to