From 06d1a29310d03a97032d9cfcff9900ae324c8520 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Thu, 10 Aug 2017 08:50:24 +0200
Subject: [PATCH] [Jenkins] Moved docs-job into gcc docker job.

---
 Jenkinsfile                 |  7 ------
 scripts/jenkins/docs.groovy | 43 -------------------------------------
 scripts/jenkins/gcc.groovy  | 21 +++++++++++++++++-
 3 files changed, 20 insertions(+), 51 deletions(-)
 delete mode 100644 scripts/jenkins/docs.groovy

diff --git a/Jenkinsfile b/Jenkinsfile
index f2ac28a4713..c51bbc3f72d 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -54,13 +54,6 @@ if (helper.isRelease(this)) {
     }
 }
 
-builders['docs'] = {
-    node('docker') {
-        dir('ogs') { checkoutWithTags() }
-        load 'ogs/scripts/jenkins/docs.groovy'
-    }
-}
-
 if (helper.isOriginMaster(this)) {
     builders['coverage'] = {
         node('docker') {
diff --git a/scripts/jenkins/docs.groovy b/scripts/jenkins/docs.groovy
deleted file mode 100644
index c3129e1758e..00000000000
--- a/scripts/jenkins/docs.groovy
+++ /dev/null
@@ -1,43 +0,0 @@
-def defaultCMakeOptions =
-    '-DOGS_LIB_BOOST=System ' +
-    '-DOGS_LIB_VTK=System ' +
-    '-DDOCS_GENERATE_LOGFILE=ON'
-
-def configure = new ogs.configure()
-def build = new ogs.build()
-def post = new ogs.post()
-def helper = new ogs.helper()
-
-def image = docker.image('ogs6/gcc-latex:latest')
-image.pull()
-image.inside() {
-    stage('Configure (Docs)') {
-        configure.linux(cmakeOptions: defaultCMakeOptions, script: this)
-    }
-
-    stage('Generate (Docs)') {
-        build.linux(script: this, target: 'doc')
-    }
-}
-
-stage('Reports (Docs)') {
-    publishHTML(target: [allowMissing: false, alwaysLinkToLastBuild: true,
-        keepAll: true, reportDir: 'build/docs', reportFiles: 'index.html',
-        reportName: 'Doxygen'])
-    step([$class: 'WarningsPublisher', canResolveRelativePaths: false,
-        messagesPattern: """
-            .*DOT_GRAPH_MAX_NODES.
-            .*potential recursive class relation.*""",
-        parserConfigurations: [[parserName: 'Doxygen', pattern:
-        'build/DoxygenWarnings.log']], unstableTotalAll: '0'])
-}
-
-if (helper.isOriginMaster(this)) {
-    stage('Deploy (Docs)') {
-        sshagent(credentials: ['www-data_jenkins']) {
-            sh 'rsync -a --delete --stats -e "ssh -o StrictHostKeyChecking=no"' +
-                ' build/docs/ www-data@jenkins.opengeosys.org:'+
-                '/var/www/doxygen.opengeosys.org'
-        }
-    }
-}
diff --git a/scripts/jenkins/gcc.groovy b/scripts/jenkins/gcc.groovy
index cc9c58f1ac6..3fd345b0b4b 100644
--- a/scripts/jenkins/gcc.groovy
+++ b/scripts/jenkins/gcc.groovy
@@ -76,11 +76,30 @@ image.inside(defaultDockerArgs) {
             keepDir: true,
             script: this
         )
-        build.linux(script: this)
+        build.linux(script: this, target: 'package doc')
     }
 }
 
 stage('Post (Linux-Docker)') {
     post.publishTestReports 'build/Testing/**/*.xml', 'build/Tests/testrunner.xml'
+
+    publishHTML(target: [allowMissing: false, alwaysLinkToLastBuild: true,
+        keepAll: true, reportDir: 'build/docs', reportFiles: 'index.html',
+        reportName: 'Doxygen'])
+    step([$class: 'WarningsPublisher', canResolveRelativePaths: false,
+        messagesPattern: """
+            .*DOT_GRAPH_MAX_NODES.
+            .*potential recursive class relation.*""",
+        parserConfigurations: [[parserName: 'Doxygen', pattern:
+        'build/DoxygenWarnings.log']], unstableTotalAll: '0'])
+
+    if (helper.isOriginMaster(this)) {
+        sshagent(credentials: ['www-data_jenkins']) {
+            sh 'rsync -a --delete --stats -e "ssh -o StrictHostKeyChecking=no"' +
+                ' build/docs/ www-data@jenkins.opengeosys.org:'+
+                '/var/www/doxygen.opengeosys.org'
+        }
+    }
+
     post.cleanup()
 }
-- 
GitLab