diff --git a/Jenkinsfile b/Jenkinsfile index 627f468fc3239d9cea45283da907d27439422482..e099bd4a2dc190a4fbeee1da37e697990d11847a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,10 +29,6 @@ pipeline { additionalBuildArgs '--pull' } } - environment { - CONTENTFUL_ACCESS_TOKEN = credentials('CONTENTFUL_ACCESS_TOKEN') - CONTENTFUL_OGS_SPACE_ID = credentials('CONTENTFUL_OGS_SPACE_ID') - } steps { script { // Install web dependencies @@ -56,7 +52,6 @@ pipeline { build { } build { target="tests" } build { target="ctest" } - build { target="web" } build { target="doc" } configure { cmakeOptions = @@ -79,16 +74,12 @@ pipeline { dir('build') { deleteDir() } } success { - dir('web/public') { stash(name: 'web') } dir('build/docs') { stash(name: 'doxygen') } dir('scripts/jenkins') { stash(name: 'known_hosts', includes: 'known_hosts') } script { publishHTML(target: [allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'build/docs', reportFiles: 'index.html', reportName: 'Doxygen']) - publishHTML(target: [allowMissing: false, alwaysLinkToLastBuild: true, - keepAll: true, reportDir: 'web/public', reportFiles: 'index.html', - reportName: 'Web']) step([$class: 'WarningsPublisher', canResolveRelativePaths: false, messagesPattern: """ .*DOT_GRAPH_MAX_NODES. @@ -293,6 +284,49 @@ pipeline { } } } + // **************************** Web ************************************ + stage('Web') { + agent { + dockerfile { + filename 'Dockerfile.gcc.full' + dir 'scripts/docker' + label 'docker' + additionalBuildArgs '--pull' + } + } + environment { + CONTENTFUL_ACCESS_TOKEN = credentials('CONTENTFUL_ACCESS_TOKEN') + CONTENTFUL_OGS_SPACE_ID = credentials('CONTENTFUL_OGS_SPACE_ID') + ALGOLIA_WRITE_KEY = credentials('ALGOLIA_WRITE_KEY') + } + steps { + dir ('web') { + sh "yarn --ignore-engines --ignore-optional --non-interactive" + sh "sudo -H pip install -r requirements.txt" + sh "(cd import && python import.py)" + sh "pandoc-citeproc --bib2json ../Documentation/bibliography.bib > data/bibliography.json" + sh "node_modules/.bin/webpack -p" + script { + if (env.JOB_NAME == 'ufz/ogs/master') { + sh "hugo --baseURL https://benchmarks.opengeosys.org" + } else { + sh ("hugo --baseURL " + env.JOB_URL + "Web/") + sh ("node_modules/.bin/hugo-algolia --toml -s") + } + } + } + } + post { + success { + dir('web/public') { stash(name: 'web') } + script { + publishHTML(target: [allowMissing: false, alwaysLinkToLastBuild: true, + keepAll: true, reportDir: 'web/public', reportFiles: 'index.html', + reportName: 'Web']) + } + } + } + } } // end parallel } // end stage Build // *************************** Log Parser ********************************** diff --git a/web/README.md b/web/README.md index 52e4474dfef1a4c8fff5d0cdaf86a3d80e753d25..e27f0992caf382200067676714bf47fb934dbbae 100644 --- a/web/README.md +++ b/web/README.md @@ -147,6 +147,12 @@ This json-file is then used by the shortcode. This fetches articles from the CMS to e.g. `ogs/web/data/news.json`. +### Update search index + +```bash +ALGOLIA_WRITE_KEY=XXX node_modules/.bin/hugo-algolia --toml -s +``` + ### Used components - [Hugo](https://gothugo.com) - Web site generator