Skip to content

Commit 510641b

Browse files
committed
add missing function used by publishDocs task
1 parent 8c13b86 commit 510641b

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

buildScript/global.gincl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,39 @@ ext.NODE = { ...cmd ->
217217
return res;
218218
}
219219

220+
/**
221+
* Publish docs to lsst.io
222+
*/
223+
ext.publishDocs = { docsDir, product ->
224+
225+
def branch = System.env.BRANCH ?: "master"
226+
docsDir = docsDir ?: "${warDir}/docs"
227+
product = product ?: "firefly"
228+
229+
if (!file(docsDir).exists()) {
230+
println ">> docs directory does not exists. Skipping publishDocs."
231+
throw new StopExecutionException("docs directory does not exists. Skipping publishDocs.")
232+
}
233+
234+
try {
235+
"ltd-mason-travis -h".execute()
236+
} catch (Exception e) {
237+
println ">> ltd-mason-travis is not installed. Task cannot continue."
238+
throw new GradleException("ltd-mason-travis is not installed. Task cannot continue.\"", e)
239+
}
240+
241+
def res = exec {
242+
environment 'LTD_MASON_BUILD': 'true'
243+
environment 'LTD_MASON_PRODUCT': product
244+
environment 'LTD_MASON_AWS_ID': 'AKIAJRVDEID2GE6GLL7Q'
245+
environment 'LTD_MASON_AWS_SECRET': project.appConfigProps['LTD_MASON_AWS_SECRET']
246+
environment 'LTD_KEEPER_URL': 'https://keeper.lsst.codes'
247+
environment 'LTD_KEEPER_USER': 'firefly'
248+
environment 'LTD_KEEPER_PASSWORD': project.appConfigProps['LTD_KEEPER_PASSWORD']
249+
environment 'TRAVIS_PULL_REQUEST': 'false'
250+
environment 'TRAVIS_REPO_SLUG': 'Caltech-IPAC/firefly'
251+
environment 'TRAVIS_BRANCH': branch
252+
commandLine "ltd-mason-travis", "--html-dir", docsDir
253+
}
254+
return res
255+
}

buildScript/tasks.gincl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ task publishJsDocs (dependsOn: loadConfig) {
451451
description = 'Publish js docs to firefly.lsst.io'
452452
group = SUB_GROUP
453453

454-
def docsDir = "${warDir}/war/docs/js"
454+
def docsDir = "${warDir}/docs/js"
455455
doLast {
456456
def res = project.publishDocs docsDir, 'firefly'
457457
if (res.getExitValue() != 0) {

0 commit comments

Comments
 (0)