This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hop.git


The following commit(s) were added to refs/heads/master by this push:
     new 9d2290e  Add documentation trigger to build
9d2290e is described below

commit 9d2290e7c772a3625c855135d1d4be5e6e29261f
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Sun Nov 8 19:38:01 2020 +0100

    Add documentation trigger to build
---
 Jenkinsfile | 75 ++++++++++++++++++++-----------------------------------------
 1 file changed, 24 insertions(+), 51 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 4f1271b..5bf2ce5 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -68,72 +68,45 @@ pipeline {
                 checkout scm
             }
         }
-        stage('Copy project docs') {
+        stage ('Start Docs build') {
             when {
                 branch 'master'
+                changeset '**/*.adoc'
             }
             steps {
-                    sh 'mkdir ./tmp'
-                    sh "find ./ -name '*.adoc' -exec cp -prv --parents '{}' 
'./tmp/' ';'"
+                echo 'Trigger Documentation Build'
+                build job: 'Hop/Hop-Documentation/asf-site', wait: false
             }
         }
-        stage('Process Docs') {
+        stage('Test & Build') {
             when {
                 branch 'master'
             }
             steps {
-                dir('hop-doc') {
+                echo 'Test & Build'
+
+                dir("local-snapshots-dir/") {
                     deleteDir()
-                    sh 'git clone -b master 
https://github.com/apache/incubator-hop-docs.git .'
-                    sh '''
-                        cd ../tmp;
-                        for f in $(find ./ -name '*.adoc')
-                        do
-                        echo "Processing $f"
-                        FILEPATH=$(grep -nr "documentationPath" $f | awk -F  
":" '{print $4}' | sed -e 's/^[[:space:]]*//');
-                        if ! [ -z "$FILEPATH" ]
-                        then
-                            mkdir -p 
../hop-doc/hop-user-manual/modules/ROOT/pages$FILEPATH && cp $f 
../hop-doc/hop-user-manual/modules/ROOT/pages$FILEPATH;
-                        fi
-                        done
-                        cd ../hop-doc
-                    '''
-                    sh 'git add .'
-                    sh 'git commit -m "Documentation updated to $GIT_COMMIT"'
-                    sh 'git push --force origin master'
+                }
 
+                sh "mvn $MAVEN_PARAMS 
-DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir 
clean deploy"
+            }
+            post {
+                always {
+                    junit(testResults: '**/surefire-reports/*.xml', 
allowEmptyResults: true)
+                    junit(testResults: '**/failsafe-reports/*.xml', 
allowEmptyResults: true)
                 }
             }
         }
-        // stage('Test & Build') {
-        //     when {
-        //         branch 'master'
-        //     }
-        //     steps {
-        //         echo 'Test & Build'
-
-        //         dir("local-snapshots-dir/") {
-        //             deleteDir()
-        //         }
-
-        //         sh "mvn $MAVEN_PARAMS 
-DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir 
clean deploy"
-        //     }
-        //     post {
-        //         always {
-        //             junit(testResults: '**/surefire-reports/*.xml', 
allowEmptyResults: true)
-        //             junit(testResults: '**/failsafe-reports/*.xml', 
allowEmptyResults: true)
-        //         }
-        //     }
-        // }
-        // stage('Deploy'){
-        //     when {
-        //         branch 'master'
-        //     }
-        //     steps{
-        //         echo 'Deploying'
-        //         sh 'mvn -X -P deploy-snapshots wagon:upload'
-        //     }
-        // }
+        stage('Deploy'){
+            when {
+                branch 'master'
+            }
+            steps{
+                echo 'Deploying'
+                sh 'mvn -X -P deploy-snapshots wagon:upload'
+            }
+        }
 
     }
     post {

Reply via email to