You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by bd...@apache.org on 2023/04/21 08:55:09 UTC

[comdev-site] branch preview/test0421 updated: Fix preview branch creation

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

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


The following commit(s) were added to refs/heads/preview/test0421 by this push:
     new 98dfcc3  Fix preview branch creation
98dfcc3 is described below

commit 98dfcc377226effef967ac7e1f647b551f3e8a7d
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Apr 21 10:54:56 2023 +0200

    Fix preview branch creation
---
 Jenkinsfile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 5ddac2f..e074086 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -118,10 +118,10 @@ pipeline {
             }
             steps {
                 script {
-                    // Checkout branch with generated content
+                    // Checkout or create branch with generated content
                     sh """
-                        git checkout ${STAGING_BRANCH}
-                        git pull origin ${STAGING_BRANCH}
+                        git checkout -B ${STAGING_BRANCH}
+                        git pull origin ${STAGING_BRANCH} || echo "branch ${STAGING_BRANCH} is new"
                     """
 
                     // Remove the content of the target branch and replace it with the content of the temp folder