-
Notifications
You must be signed in to change notification settings - Fork 74
Added nightly doc build triggers #3634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,11 +19,84 @@ pipeline { | |
| string(name: "PACKAGE_JOB", defaultValue: 'cf-remote', description: 'where to get CFEngine HUB package from, either a dir at http://buildcache.cloud.cfengine.com/packages like testing-pr or a keyword cf-remote to use cf-remote download') | ||
| string(name: "USE_NIGHTLIES_FOR", defaultValue: '', description: 'branch whose nightlies to use (master, 3.18.x, etc) - will be one of http://buildcache.cloud.cfengine.com/packages/testing-pr/jenkins-$USE_NIGHTLIES_FOR-nightly-pipeline-$NUMBER/') | ||
| } | ||
| triggers { | ||
| // Run nightly at 2 AM to trigger builds for master, 3.27, 3.24, and lts | ||
| cron('H 2 * * *') | ||
| } | ||
| options { | ||
| checkoutToSubdirectory('documentation') | ||
| } | ||
| stages { | ||
| stage('Trigger Nightly Builds') { | ||
| when { | ||
| triggeredBy 'TimerTrigger' | ||
| } | ||
| steps { | ||
| script { | ||
| echo "Triggered by cron - launching builds for master, 3.27, 3.24, and lts" | ||
|
|
||
| // Build master | ||
| build job: env.JOB_NAME, parameters: [ | ||
| string(name: 'CORE_REV', value: 'master'), | ||
| string(name: 'ENTERPRISE_REV', value: 'master'), | ||
| string(name: 'NOVA_REV', value: 'master'), | ||
| string(name: 'MASTERFILES_REV', value: 'master'), | ||
| string(name: 'DOCS_REV', value: 'master'), | ||
| string(name: 'NT_DOCS_REV', value: 'main'), | ||
| string(name: 'DOCS_BRANCH', value: 'master'), | ||
| string(name: 'PACKAGE_JOB', value: 'cf-remote'), | ||
| string(name: 'USE_NIGHTLIES_FOR', value: 'master') | ||
| ], wait: false | ||
|
|
||
| // Build 3.27 | ||
| build job: env.JOB_NAME, parameters: [ | ||
| string(name: 'CORE_REV', value: '3.27.x'), | ||
| string(name: 'ENTERPRISE_REV', value: '3.27.x'), | ||
| string(name: 'NOVA_REV', value: '3.27.x'), | ||
| string(name: 'MASTERFILES_REV', value: '3.27.x'), | ||
| string(name: 'DOCS_REV', value: '3.27'), | ||
| string(name: 'NT_DOCS_REV', value: 'main'), | ||
| string(name: 'DOCS_BRANCH', value: '3.27'), | ||
| string(name: 'PACKAGE_JOB', value: 'cf-remote'), | ||
| string(name: 'USE_NIGHTLIES_FOR', value: '3.27.x') | ||
| ], wait: false | ||
|
|
||
| // Build 3.24 | ||
| build job: env.JOB_NAME, parameters: [ | ||
| string(name: 'CORE_REV', value: '3.24.x'), | ||
| string(name: 'ENTERPRISE_REV', value: '3.24.x'), | ||
| string(name: 'NOVA_REV', value: '3.24.x'), | ||
| string(name: 'MASTERFILES_REV', value: '3.24.x'), | ||
| string(name: 'DOCS_REV', value: '3.24'), | ||
| string(name: 'NT_DOCS_REV', value: 'main'), | ||
| string(name: 'DOCS_BRANCH', value: '3.24'), | ||
| string(name: 'PACKAGE_JOB', value: 'cf-remote'), | ||
| string(name: 'USE_NIGHTLIES_FOR', value: '3.24.x') | ||
| ], wait: false | ||
|
|
||
| // Build lts (3.27.x code deployed to lts location) | ||
| build job: env.JOB_NAME, parameters: [ | ||
| string(name: 'CORE_REV', value: '3.27.x'), | ||
| string(name: 'ENTERPRISE_REV', value: '3.27.x'), | ||
| string(name: 'NOVA_REV', value: '3.27.x'), | ||
| string(name: 'MASTERFILES_REV', value: '3.27.x'), | ||
| string(name: 'DOCS_REV', value: '3.27'), | ||
| string(name: 'NT_DOCS_REV', value: 'main'), | ||
| string(name: 'DOCS_BRANCH', value: 'lts'), | ||
| string(name: 'PACKAGE_JOB', value: 'cf-remote'), | ||
| string(name: 'USE_NIGHTLIES_FOR', value: '3.27.x') | ||
| ], wait: false | ||
|
|
||
| echo "All nightly builds triggered successfully" | ||
| } | ||
| } | ||
| } | ||
| stage('Environment check') { | ||
| when { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why skip these?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think so that a manual trigger doesn't cause all of them to build this one cron trigger causes master, 3.27, 3.24 and lts (which is 3.27 but targeting /lts ) to build. |
||
| not { | ||
| triggeredBy 'TimerTrigger' | ||
| } | ||
| } | ||
| steps { | ||
| sh 'env' | ||
| sh 'whoami; pwd; ls' | ||
|
|
@@ -32,11 +105,21 @@ pipeline { | |
| } | ||
| // we clean FIRST and NOT at the end of the job so that we can replay various stages and have the build result from previous runs | ||
| stage('Clean workspace') { | ||
| when { | ||
| not { | ||
| triggeredBy 'TimerTrigger' | ||
| } | ||
| } | ||
| steps { | ||
| sh 'for r in $REPOS; do rm -rf "$(basename "$r")"; done' | ||
| } | ||
| } | ||
| stage('Checkout repositories'){ | ||
| when { | ||
| not { | ||
| triggeredBy 'TimerTrigger' | ||
| } | ||
| } | ||
| steps { | ||
| script { | ||
| if (env.CHANGE_ID) { | ||
|
|
@@ -57,11 +140,21 @@ pipeline { | |
| } | ||
| } | ||
| stage('Build documentation') { | ||
| when { | ||
| not { | ||
| triggeredBy 'TimerTrigger' | ||
| } | ||
| } | ||
| steps { | ||
| sh 'bash -x documentation/generator/build/run.sh' | ||
| } | ||
| } | ||
| stage('Publish to buildcache') { | ||
| when { | ||
| not { | ||
| triggeredBy 'TimerTrigger' | ||
| } | ||
| } | ||
| steps { | ||
| sshPublisher( | ||
| // we must use alwaysPublishFromMaster: true because our CONTAINERS build hosts are not in the private network which has access to buildcache.cloud.cfengine.com | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to parameterize this a bit so not so much repetition, but there are differences here and there.