Skip to content

Commit

Permalink
Rearranging
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjan Dikhoff committed Oct 25, 2024
1 parent c3441a0 commit d82a324
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ DATE=`date`
WORK_DIR=`pwd`
REPORT_DIR="$WORK_DIR/build-report"
REPORT_FILE="$REPORT_DIR/index.html"
SSH_COMMAND="ssh -v"

GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`
if [ -n "$CF_PAGES" ]
then
echo "We are on Cloudflare Pages. Retrieve branch from env."
GIT_BRANCH=$CF_PAGES_BRANCH

echo "Remove Cloudflare redirect."
# HACK: Remove annoying https redirect. I presume this was used by Cloudflare
insteadof=`git config --list | grep insteadof`
remove=`echo $insteadof | cut -d "=" -f 1`
git config --global --unset $remove
fi
GIT_COMMIT_MESSAGE="branch $GIT_BRANCH on $DATE"
GIT_LIVE_BRANCH=${2:-develop}
Expand Down Expand Up @@ -60,7 +65,10 @@ cd $REPO_DIR
echo "Checking out $GIT_LIVE_BRANCH"
git checkout $GIT_LIVE_BRANCH

SSH_COMMAND="ssh" # Add -v, -vv, or -vvv for verbose debugging
git config --global core.sshCommand "$SSH_COMMAND"
echo "Using ssh command: $SSH_COMMAND"

if [ -n "$CF_PAGES" ]
then
echo "We are on Cloudflare Pages. Setting custom ssh key and method"
Expand All @@ -74,30 +82,18 @@ then
chmod 0644 ~/.ssh/known_hosts
chmod 0755 ~/.ssh

#git config --global remote.origin.url [email protected]:Redot-Engine/redot-docs-live.git

# HACK: remove annoying https redirect
insteadof=`git config --list | grep insteadof`
remove=`echo $insteadof | cut -d "=" -f 1`
git config --global --unset $remove

git remote set-url origin [email protected]:Redot-Engine/redot-docs-live.git

echo "Setting credentials"
git config --global user.email "[email protected]"
git config --global user.name "Redot Docs Build Worker"
fi
echo "#########################"
cat .git/config
echo "#########################"
ls -la ~/.ssh
cat ~/.ssh/id_ed25519.pub
cat ~/.ssh/known_hosts
ssh -T [email protected]
echo "#########################"

echo "### GIT CONFIG VALUES ###"
git config --global core.pager cat
git config --list

echo "Copying generated content to repository"
echo "mkdir -p $BUILD_DIR"
mkdir -p $BUILD_DIR
echo "cp -r ../$SPHINX_DIR/* $BUILD_DIR"
Expand Down

0 comments on commit d82a324

Please sign in to comment.