[arvados] created: 2.7.0-5288-g9f42b105d7

git repository hosting git at public.arvados.org
Fri Nov 3 15:12:38 UTC 2023


        at  9f42b105d76cffd91e2d91a6b5d25ff4418f192c (commit)


commit 9f42b105d76cffd91e2d91a6b5d25ff4418f192c
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Fri Nov 3 12:10:43 2023 -0300

    21041: Improves the sync() function so that it can push code from HEAD.
    
    When running the installer from a Jenkins pipeline, the checked out code
    may not be from a specific branch, so we need to take care of this special
    case when pushing the code to the bare repositories on the nodes.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/tools/salt-install/installer.sh b/tools/salt-install/installer.sh
index bb57666da6..27feffa2d2 100755
--- a/tools/salt-install/installer.sh
+++ b/tools/salt-install/installer.sh
@@ -103,8 +103,15 @@ sync() {
     # from that.
 
     $SSH $DEPLOY_USER@$NODE git init --bare --shared=0600 ${GITTARGET}.git
-    $GIT push $NODE $BRANCH
-    $SSH $DEPLOY_USER@$NODE "umask 0077 && git clone -s ${GITTARGET}.git ${GITTARGET} && git -C ${GITTARGET} checkout ${BRANCH}"
+    if [[ "$BRANCH" == "HEAD" ]]; then
+      # When deploying from an individual commit instead of a branch. This can
+      # happen when deploying from a Jenkins pipeline.
+      $GIT push $NODE HEAD:refs/heads/HEAD
+      $SSH $DEPLOY_USER@$NODE "umask 0077 && git clone -s ${GITTARGET}.git ${GITTARGET} && git -C ${GITTARGET} checkout remotes/origin/HEAD"
+    else
+      $GIT push $NODE $BRANCH
+      $SSH $DEPLOY_USER@$NODE "umask 0077 && git clone -s ${GITTARGET}.git ${GITTARGET} && git -C ${GITTARGET} checkout ${BRANCH}"
+    fi
   fi
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list