forked from godotengine/godot-docs
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Arjan Dikhoff
committed
Oct 25, 2024
1 parent
b40f2df
commit 58f3adb
Showing
1 changed file
with
29 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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="[email protected]:Redot-Engine/$LIVE_ROOT.git" | ||
BUILD_DIR="html/en/$gitBranch" | ||
liveRoot="redot-docs-live" | ||
liveRepo="[email protected]: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 . | ||
|