Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pipeline {
environment {
REPOS = "core enterprise nova masterfiles northerntechhq/nt-docs"
PR_BASE = getPR_BASE()
DOCS_BRANCH = getDOCS_BRANCH()
PACKAGE_JOB = "cf-remote"
PACKAGE_UPLOAD_DIRECTORY = "n/a"
PACKAGE_BUILD = "n/a"
Expand All @@ -14,7 +15,7 @@ pipeline {
string(name: "MASTERFILES_REV", defaultValue: '', description: 'used to document masterfiles. Use NUMBER or "pull/NUMBER/merge" for pull request (it\'s merged version, THIS DOESN\'T MERGE THE PR) or "pull/NUMBER/head" to build the docs with the non-merged code. Special syntax \'tag:SOME_TAG\' can be used to use a tag as a revision.')
string(name: "DOCS_REV", defaultValue: '', description: 'Use NUMBER or "pull/NUMBER/merge" for pull request (it\'s merged version, THIS DOESN\'T MERGE THE PR) or "pull/NUMBER/head" to build the docs with the non-merged code. Special syntax \'tag:SOME_TAG\' can be used to use a tag as a revision.')
string(name: "NT_DOCS_REV", defaultValue: '', description: 'Use NUMBER or "pull/NUMBER/merge" for pull request (it\'s merged version, THIS DOESN\'T MERGE THE PR) or "pull/NUMBER/head" to build the docs with the non-merged code. Special syntax \'tag:SOME_TAG\' can be used to use a tag as a revision.')
string(name: "DOCS_BRANCH", defaultValue: getDOCS_BRANCH(), description: 'Where to upload artifacts - to http://buildcache.cloud.cfengine.com/packages/build-documentation-$DOCS_BRANCH/ and https://docs.cfengine.com/docs/$DOCS_BRANCH/')
string(name: "DOCS_BRANCH", defaultValue: '', description: 'Where to upload artifacts - to http://buildcache.cloud.cfengine.com/packages/build-documentation-$DOCS_BRANCH/ and https://docs.cfengine.com/docs/$DOCS_BRANCH/')
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/')
}
Expand Down Expand Up @@ -110,7 +111,7 @@ mv upload/* output
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: 'upload/$BUILD_TAG/build-documentation-$DOCS_BRANCH/$BUILD_TAG/',
remoteDirectory: getRemoteDirectory(),
remoteDirectorySDF: false,
removePrefix: '',
sourceFiles: 'output/'
Expand All @@ -127,7 +128,9 @@ mv upload/* output
} // stages
}
def getDOCS_BRANCH() {
if (env.CHANGE_ID) {
if (env.DOCS_BRANCH) {
return env.DOCS_BRANCH
} else if (env.CHANGE_ID) {
return "${env.CHANGE_TARGET}"
} else {
return "${env.BRANCH_NAME}"
Expand All @@ -140,3 +143,6 @@ def getPR_BASE() {
return ""
}
}
def getRemoteDirectory() {
return "upload/${env.BUILD_TAG}/build-documentation-${env.DOCS_BRANCH}/${env.BUILD_TAG}/"
}