From e048c00ac7e5e07ea0b467003d1a17de940dbc13 Mon Sep 17 00:00:00 2001 From: Arjan Dikhoff Date: Fri, 25 Oct 2024 13:51:31 +0200 Subject: [PATCH] Try different command tag --- build.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index c799db2076b5..0215dd6a0631 100755 --- a/build.sh +++ b/build.sh @@ -7,7 +7,7 @@ REPORT_FILE="$REPORT_DIR/index.html" GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` if [ $CF_PAGES -gt 0 ] then - echo "We are on pages" + echo "We are on Cloudflare Pages. Retrieve branch from env." GIT_BRANCH=$CF_PAGES_BRANCH fi GIT_COMMIT_MESSAGE="branch $GIT_BRANCH on $DATE" @@ -23,8 +23,6 @@ LIVE_REPO="git@github.com:Redot-Engine/$LIVE_ROOT.git" BUILD_DIR="html/en/$GIT_BRANCH" WORK_DIR=`pwd` -echo "###############################" - mkdir -p $REPORT_DIR rm $REPORT_FILE echo "reporting to $REPORT_FILE" 2>&1 | tee -a $REPORT_FILE @@ -46,11 +44,15 @@ echo "Translate to html" mkdir -p $SPHINX_DIR sphinx-build -b html -j 4 $MIGRATE_DIR $SPHINX_DIR 2>&1 | tee -a $REPORT_FILE -echo "Setting ssh key" -echo $BUILD_SSH_KEY > $WORK_DIR/id_priv -SSH_COMMAND="ssh -vvv -i $WORK_DIR/id_priv" -echo $SSH_COMMAND -git config --global core.sshcommand "$SSH_COMMAND" +if [ $CF_PAGES -gt 0 ] +then + echo "We are on Cloudflare Pages. Setting custom ssh key and method" + echo $BUILD_SSH_KEY > $WORK_DIR/id_priv + SSH_COMMAND="ssh -vvv -i $WORK_DIR/id_priv" + echo $SSH_COMMAND + git config --global core.sshCommand "$SSH_COMMAND" +fi + echo "Cloning $LIVE_REPO $REPO_DIR" git clone $LIVE_REPO $REPO_DIR 2>&1 | tee -a $REPORT_FILE echo "Checking out $GIT_LIVE_BRANCH"