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 bde8f94  Add documentation add
bde8f94 is described below

commit bde8f94dae406becf6f67ca8dba45c34e3d816a5
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Sun Nov 8 14:24:08 2020 +0100

    Add documentation add
---
 Jenkinsfile | 81 +++++++++++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 66 insertions(+), 15 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index bdc87d5..4f953ff 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -68,35 +68,86 @@ pipeline {
                 checkout scm
             }
         }
-        stage('Test & Build') {
+        stage('Copy project docs') {
             when {
                 branch 'master'
             }
             steps {
-                echo 'Test & Build'
-
-                dir("local-snapshots-dir/") {
+                    sh 'mkdir ./tmp'
+                    sh "find ./ -name '*.adoc' -exec cp -prv --parents '{}' 
'./tmp/' ';'"
+            }
+        }
+        stage('Checkout Docs') {
+            when {
+                branch 'master'
+            }
+            steps {
+                dir('hop-doc') {
                     deleteDir()
+                    sh 'git clone -b master 
https://gitbox.apache.org/repos/asf/incubator-hop-docs.git .'
                 }
-
-                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('Copy docs') {
+            when {
+                branch 'master'
+            }
+            steps {
+                    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
+                    '''
             }
         }
-        stage('Deploy'){
+        stage('Push Documentation') {
             when {
                 branch 'master'
             }
-            steps{
-                echo 'Deploying'
-                sh 'mvn -X -P deploy-snapshots wagon:upload'
+            steps {
+                dir('hop-doc') {
+                    sh 'git add .'
+                    sh 'git commit -m "Documentation updated to $GIT_COMMIT"'
+                    sh 'git push --force origin master'
+                }
             }
         }
+        // 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'
+        //     }
+        // }
 
     }
     post {

Reply via email to