Skip to content
Snippets Groups Projects
Commit 5b20e362 authored by Lars Bilke's avatar Lars Bilke Committed by Lars Bilke
Browse files

[web] Publish web on Jenkins or on web sever (ufz/master only).

parent 29f71a9b
No related branches found
No related tags found
No related merge requests found
...@@ -3,8 +3,7 @@ def defaultCMakeOptions = ...@@ -3,8 +3,7 @@ def defaultCMakeOptions =
'-DCMAKE_BUILD_TYPE=Release ' + '-DCMAKE_BUILD_TYPE=Release ' +
'-DOGS_LIB_BOOST=System ' + '-DOGS_LIB_BOOST=System ' +
'-DOGS_LIB_EIGEN=Local ' + '-DOGS_LIB_EIGEN=Local ' +
'-DOGS_LIB_VTK=System ' + '-DOGS_LIB_VTK=System '
'-DOGS_WEB_BASE_URL=$JOB_URL"Web/" '
def guiCMakeOptions = def guiCMakeOptions =
'-DOGS_BUILD_CLI=OFF ' + '-DOGS_BUILD_CLI=OFF ' +
...@@ -18,6 +17,10 @@ def build = new ogs.build() ...@@ -18,6 +17,10 @@ def build = new ogs.build()
def post = new ogs.post() def post = new ogs.post()
def helper = new ogs.helper() def helper = new ogs.helper()
def webCMakeOptions = '-DOGS_WEB_BASE_URL=$JOB_URL"Web/" '
if (helper.isOriginMaster(this))
webCMakeOptions = '-DOGS_WEB_BASE_URL=https://dev.opengeosys.org'
def image = docker.image('ogs6/gcc-gui:latest') def image = docker.image('ogs6/gcc-gui:latest')
image.pull() image.pull()
image.inside(defaultDockerArgs) { image.inside(defaultDockerArgs) {
...@@ -26,7 +29,7 @@ image.inside(defaultDockerArgs) { ...@@ -26,7 +29,7 @@ image.inside(defaultDockerArgs) {
sh 'cd ogs/web && npm install && sudo -H pip install -r requirements.txt' sh 'cd ogs/web && npm install && sudo -H pip install -r requirements.txt'
} }
stage('Configure (Linux-Docker)') { stage('Configure (Linux-Docker)') {
configure.linux(cmakeOptions: defaultCMakeOptions, script: this) configure.linux(cmakeOptions: defaultCMakeOptions + webCMakeOptions, script: this)
} }
stage('CLI (Linux-Docker)') { stage('CLI (Linux-Docker)') {
...@@ -46,19 +49,16 @@ image.inside(defaultDockerArgs) { ...@@ -46,19 +49,16 @@ image.inside(defaultDockerArgs) {
build.linux(script: this, target: 'web') build.linux(script: this, target: 'web')
publishHTML(target: [allowMissing: false, alwaysLinkToLastBuild: false, if (helper.isOriginMaster(this)) {
keepAll: false, reportDir: 'ogs/web/public', reportFiles: 'index.html', sshagent(credentials: ['www-data_jenkins']) {
reportName: 'Web']) sh 'rsync -a --delete --stats -e "ssh -o StrictHostKeyChecking=no"' +
' ogs/web/public/ www-data@jenkins.opengeosys.org:'+
configure.linux( '/var/www/dev.opengeosys.org'
cmakeOptions: "-DOGS_WEB_BASE_URL=https://dev.opengeosys.org", }
script: this) } else {
build.linux(script: this, target: 'web') publishHTML(target: [allowMissing: false, alwaysLinkToLastBuild: false,
keepAll: false, reportDir: 'ogs/web/public', reportFiles: 'index.html',
sshagent(credentials: ['www-data_jenkins']) { reportName: 'Web'])
sh 'rsync -a --delete --stats -e "ssh -o StrictHostKeyChecking=no"' +
' ogs/web/public/ www-data@jenkins.opengeosys.org:'+
'/var/www/dev.opengeosys.org'
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment