diff --git a/pipelines/lib/util.groovy b/pipelines/lib/util.groovy index cb34b951..655b2433 100644 --- a/pipelines/lib/util.groovy +++ b/pipelines/lib/util.groovy @@ -1224,6 +1224,59 @@ def void librarianPuppet(String cmd='install', String tag='2.2.3') { } } +/** + * Build pipelines.lsst.io docs + * + * @param p Map + * @param p.nodeLabel String label of node to build on + * @param p.workspace String directory containing lsstsw build + * @param p.baseImage String base docker image + * @param p.manifestId String manifest id of lsst_distrib build + * @param p.eupsTag String tag to publish under + */ +def buildPipelinesDocs(Map p) { + requireMapKeys(p, [ + 'nodeLabel', + 'workspace', + 'baseImage', + 'manifestId, + 'eupsTag', + ]) + nodeWrap(p.nodeLabel) { + ws(p.workspace) { + dir("pipelines_lsst_io") { + gitNoNoise( + url: githubSlugToUrl("lsst/pipelines_lsst_io"), + branch: "main", + ) + } + insideDockerWrap( + image: p.baseImage, + pull: true, + ) { + withCredentials([[ + $class: 'UsernamePasswordMultiBinding', + credentialsId: 'ltd-keeper', + usernameVariable: 'LTD_KEEPER_USER', + passwordVariable: 'LTD_KEEPER_PASSWORD', + ]]) { + bash """ + source "$WORKSPACE"/lsstsw/bin/envconfig + mamba install -y --no-update-deps --force-reinstall lsst-documenteer-pipelines + setup -r "$WORKSPACE"/pipelines_lsst_io -t ${p.manifestId} + cd "$WORKSPACE"/pipelines_lsst_io + stack-docs build + rm -rf "$WORKSPACE"/pipelines_lsst_io/envs/ltd + mamba create -y -p "$WORKSPACE"/pipelines_lsst_io/envs/ltd ltd-conveyor + conda activate "$WORKSPACE"/pipelines_lsst_io/envs/ltd + ltd -u $LTD_KEEPER_USER -p $LTD_KEEPER_PASSWORD upload --product pipelines --dir _build/html --git-ref ${p.eupsTag} + """ + } // withCredentials + } // docker + } // ws + } // node +} // def + /** * run documenteer doc build * diff --git a/pipelines/release/nightly_release.groovy b/pipelines/release/nightly_release.groovy index c1a61ca2..767ea2c6 100644 --- a/pipelines/release/nightly_release.groovy +++ b/pipelines/release/nightly_release.groovy @@ -175,21 +175,15 @@ notify.wrap { } triggerMe['doc build'] = { - retry(retries) { - build( - job: 'sqre/infra/documenteer', - parameters: [ - string(name: 'EUPS_TAG', value: eupsTag), - string(name: 'LTD_SLUG', value: eupsTag), - string(name: 'RELEASE_IMAGE', value: stackResults.image), - booleanParam( - name: 'PUBLISH', - value: scipipe.release.step.documenteer.publish, - ), - ], - wait: false, - ) - } // retry + stage('build and publish docs') { + util.buildPipelinesDocs( + nodeLabel: lsstswConfig.label, + workspace: scipipe.canonical.workspace, + baseImage: lsstswConfig.image, + manifestId: manifestId, + eupsTag: eupsTag, + ) + } // stage } triggerMe['ap_verify'] = { diff --git a/pipelines/release/weekly_release.groovy b/pipelines/release/weekly_release.groovy index 9923bd1f..ae3bfd95 100644 --- a/pipelines/release/weekly_release.groovy +++ b/pipelines/release/weekly_release.groovy @@ -175,21 +175,15 @@ notify.wrap { } triggerMe['doc build'] = { - retry(retries) { - build( - job: 'sqre/infra/documenteer', - parameters: [ - string(name: 'EUPS_TAG', value: eupsTag), - string(name: 'LTD_SLUG', value: eupsTag), - string(name: 'RELEASE_IMAGE', value: stackResults.image), - booleanParam( - name: 'PUBLISH', - value: scipipe.release.step.documenteer.publish, - ), - ], - wait: false, + stage('build and publish docs') { + util.buildPipelinesDocs( + nodeLabel: lsstswConfig.label, + workspace: scipipe.canonical.workspace, + baseImage: lsstswConfig.image, + manifestId: manifestId, + eupsTag: eupsTag, ) - } // retry + } // stage } triggerMe['ap_verify'] = {