You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2023/04/26 16:27:58 UTC

[comdev-site] branch preview/test3 updated: More fixes

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

sebb pushed a commit to branch preview/test3
in repository https://gitbox.apache.org/repos/asf/comdev-site.git


The following commit(s) were added to refs/heads/preview/test3 by this push:
     new 372908d  More fixes
372908d is described below

commit 372908d0bf995e2510c833fa800527d596dbbb31
Author: Sebb <se...@apache.org>
AuthorDate: Wed Apr 26 17:27:50 2023 +0100

    More fixes
---
 Jenkinsfile | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 0a56fc1..abc3f78 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -85,15 +85,19 @@ pipeline {
             }
             steps {
                 script {
-                    // Checkout branch with generated content
+                    // Checkout branch with generated content, creating it if necessary
                     sh """
-                        git checkout ${DEPLOY_BRANCH} || {
+                        if git checkout ${DEPLOY_BRANCH}
+                        then
+                          git pull origin ${DEPLOY_BRANCH}
+                        else
                           echo "branch ${DEPLOY_BRANCH} is new; create basic site"
-                          git checkout --orphan ${DEPLOY_BRANCH}
+                          git checkout --orphan ${DEPLOY_BRANCH} -f
+                          rm -rf .
                           # assume we have an asf.yaml file
-                          git checkout ${BRANCH_NAME} -- .asf.yaml -f && git add .asf.yaml -f
-                        }
-                        git pull origin ${DEPLOY_BRANCH}
+                          git checkout ${BRANCH_NAME} -- .asf.yaml -f
+                          git add .asf.yaml -f
+                        fi
                     """
                     
                     // Remove the content of the target branch and replace it with the content of the temp folder