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
Showing
2 changed files
with
29 additions
and
22 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 |
---|---|---|
|
@@ -7,6 +7,7 @@ _build-old/ | |
_migrated/ | ||
_sphinx/ | ||
_repo/ | ||
build-report/ | ||
env/ | ||
__pycache__ | ||
*.pyc | ||
|
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 |
---|---|---|
@@ -1,51 +1,57 @@ | ||
#!/bin/bash | ||
|
||
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` | ||
DATE=`date` | ||
REPORT_DIR="build-report" | ||
REPORT_FILE="$REPORT_DIR/index.html" | ||
|
||
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` | ||
GIT_COMMIT_MESSAGE="branch $GIT_BRANCH on $DATE" | ||
GIT_LIVE_BRANCH=${2:-develop} | ||
echo "Building $GIT_COMMIT_MESSAGE" | ||
echo "Live branch: $GIT_LIVE_BRANCH" | ||
|
||
INPUT_DIR="." | ||
MIGRATE_DIR="_migrated" | ||
SPHINX_DIR="_sphinx" | ||
REPO_DIR="_repo" | ||
echo "Temp dirs: $MIGRATE_DIR, $SPHINX_DIR, $REPO_DIR" | ||
|
||
LIVE_ROOT="redot-docs-live" | ||
LIVE_REPO="[email protected]:Redot-Engine/$LIVE_ROOT.git" | ||
BUILD_DIR="html/en/$GIT_BRANCH" | ||
|
||
echo "Live root: $LIVE_ROOT, live repo: $LIVE_REPO, build dir: $BUILD_DIR" | ||
mkdir -p $REPORT_DIR | ||
rm $REPORT_FILE | ||
echo "reporting to $REPORT_FILE" 2>&1 | tee -a $REPORT_FILE | ||
echo "Building $GIT_COMMIT_MESSAGE" 2>&1 | tee -a $REPORT_FILE | ||
echo "Live branch: $GIT_LIVE_BRANCH" 2>&1 | tee -a $REPORT_FILE | ||
echo "Temp dirs: $MIGRATE_DIR, $SPHINX_DIR, $REPO_DIR" 2>&1 | tee -a $REPORT_FILE | ||
echo "Live root: $LIVE_ROOT, live repo: $LIVE_REPO, build dir: $BUILD_DIR, report dir: $REPORT_DIR" 2>&1 | tee -a $REPORT_FILE | ||
|
||
echo "Migrate Godot to Redot, options $1" | ||
echo "Delete temps" 2>&1 | tee -a $REPORT_FILE | ||
rm -rf $MIGRATE_DIR 2>&1 | tee -a $REPORT_FILE | ||
rm -rf $SPHINX_DIR 2>&1 | tee -a $REPORT_FILE | ||
rm -rf $REPO_DIR 2>&1 | tee -a $REPORT_FILE | ||
|
||
echo "Migrate Godot to Redot, options $1" 2>&1 | tee -a $REPORT_FILE | ||
mkdir -p $MIGRATE_DIR | ||
python migrate.py $1 $INPUT_DIR $MIGRATE_DIR | ||
python migrate.py $1 $INPUT_DIR $MIGRATE_DIR 2>&1 | tee -a $REPORT_FILE | ||
|
||
echo "Translate to html" | ||
mkdir -p $SPHINX_DIR | ||
sphinx-build -b html -j 4 $MIGRATE_DIR $SPHINX_DIR | ||
sphinx-build -b html -j 4 $MIGRATE_DIR $SPHINX_DIR 2>&1 | tee -a $REPORT_FILE | ||
|
||
echo "Cloning $LIVE_REPO $REPO_DIR" | ||
git clone $LIVE_REPO $REPO_DIR | ||
git clone $LIVE_REPO $REPO_DIR 2>&1 | tee -a $REPORT_FILE | ||
|
||
echo "Checking out $GIT_LIVE_BRANCH" | ||
cd $REPO_DIR | ||
git checkout $GIT_LIVE_BRANCH | ||
git checkout $GIT_LIVE_BRANCH 2>&1 | tee -a $REPORT_FILE | ||
echo "mkdir -p $BUILD_DIR" | ||
mkdir -p $BUILD_DIR | ||
echo "cp -r ../$SPHINX_DIR/* $BUILD_DIR" | ||
cp -r ../$SPHINX_DIR/* $BUILD_DIR | ||
|
||
echo "Commit and push to $GIT_REMOTE_BRANCH, with message $GIT_COMMIT_MESSAGE" | ||
git add . | ||
git commit -m "$GIT_COMMIT_MESSAGE" | ||
git push -f | ||
echo "cp -r ../$SPHINX_DIR/* $BUILD_DIR" 2>&1 | tee -a $REPORT_FILE | ||
cp -r ../$SPHINX_DIR/* $BUILD_DIR 2>&1 | tee -a $REPORT_FILE | ||
|
||
echo "Delete temps" | ||
rm -rf $MIGRATE_DIR | ||
rm -rf $SPHINX_DIR | ||
rm -rf $REPO_DIR | ||
echo "Commit and push to $GIT_REMOTE_BRANCH, with message $GIT_COMMIT_MESSAGE" 2>&1 | tee -a $REPORT_FILE | ||
git add . 2>&1 | tee -a $REPORT_FILE | ||
git commit -m "$GIT_COMMIT_MESSAGE" 2>&1 | tee -a $REPORT_FILE | ||
git push -f 2>&1 | tee -a $REPORT_FILE | ||
|
||
echo "Done. Made by @Craptain" | ||
echo "Done. Made by @Craptain" 2>&1 | tee -a $REPORT_FILE |