diff --git a/build.sh b/build.sh index ac1c8e41cba3..524eb744d667 100755 --- a/build.sh +++ b/build.sh @@ -6,6 +6,7 @@ date=`date` workDir=`pwd` reportDir="$workDir/build-report" reportFile="$reportDir/index.html" +sshCommand="ssh -v" # Add -v, -vv, or -vvv for verbose debugging gitBranch=`git rev-parse --abbrev-ref HEAD` if [ -n "$CF_PAGES" ] @@ -16,52 +17,51 @@ fi gitCommitMessage="branch $gitBranch on $date" redotDocsLiveBranch=${2:-develop} -INPUT_DIR="." -MIGRATE_DIR="_migrated" -SPHINX_DIR="_sphinx" -REPO_DIR="_repo" +inputDir="." +migrateDir="_migrated" +sphinxDir="_sphinx" +repoDir="_repo" -LIVE_ROOT="redot-docs-live" -LIVE_REPO="git@github.com:Redot-Engine/$LIVE_ROOT.git" -BUILD_DIR="html/en/$gitBranch" +liveRoot="redot-docs-live" +liveRepo="git@github.com:Redot-Engine/$liveRoot.git" +buildDir="html/en/$gitBranch" # TODO: implement i18n support # Report vars and intention mkdir -p $reportDir rm $reportFile -echo "reporting to $reportFile" echo "Building $gitCommitMessage" echo "Live branch: $redotDocsLiveBranch" -echo "Temp dirs: $MIGRATE_DIR, $SPHINX_DIR, $REPO_DIR" -echo "Live root: $LIVE_ROOT, live repo: $LIVE_REPO, build dir: $BUILD_DIR, report dir: $reportDir" +echo "Live root: $liveRoot, live repo: $liveRepo, build dir: $buildDir, report dir: $reportDir" +echo "Temp dirs: $migrateDir, $sphinxDir, $repoDir" +echo "reporting to $reportFile" -echo "Delete temps" -rm -rf $MIGRATE_DIR -rm -rf $SPHINX_DIR -rm -rf $REPO_DIR +echo "Delete temp dirs" +rm -rf $migrateDir +rm -rf $sphinxDir +rm -rf $repoDir # Init git echo "Migrate Godot to Redot, options $1" -mkdir -p $MIGRATE_DIR -# python migrate.py $1 $INPUT_DIR $MIGRATE_DIR +mkdir -p $migrateDir +# python migrate.py $1 $inputDir $migrateDir echo "Translate to html" -mkdir -p $SPHINX_DIR -# sphinx-build -b html -j 4 $MIGRATE_DIR $SPHINX_DIR +mkdir -p $sphinxDir +# sphinx-build -b html -j 4 $migrateDir $sphinxDir -echo "DUMMY FILE FOR TESTING: $date" > $SPHINX_DIR/test.html +echo "DUMMY FILE FOR TESTING: $date" > $sphinxDir/test.html -echo "Cloning $LIVE_REPO $REPO_DIR" -git clone $LIVE_REPO $REPO_DIR +echo "Cloning $liveRepo $repoDir" +git clone $liveRepo $repoDir -cd $REPO_DIR +cd $repoDir echo "Checking out $redotDocsLiveBranch" git checkout $redotDocsLiveBranch -SSH_COMMAND="ssh -v" # Add -v, -vv, or -vvv for verbose debugging -git config core.sshCommand "$SSH_COMMAND" -echo "Using ssh command: $SSH_COMMAND" +git config core.sshCommand "$sshCommand" +echo "Using ssh command: $sshCommand" if [ -n "$CF_PAGES" ] then @@ -94,10 +94,10 @@ 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" -cp -r ../$SPHINX_DIR/* $BUILD_DIR +echo "mkdir -p $buildDir" +mkdir -p $buildDir +echo "cp -r ../$sphinxDir/* $buildDir" +cp -r ../$sphinxDir/* $buildDir echo "Commit and push to $redotDocsLiveBranch, with message $gitCommitMessage" git add .