Skip to content

Commit

Permalink
Test version up
Browse files Browse the repository at this point in the history
  • Loading branch information
adikhoff committed Oct 24, 2024
1 parent 93cf3b1 commit 7af0817
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
_build/
_build-old/
_migrated/
_sphinx/
_repo/
env/
__pycache__
*.pyc
Expand Down
47 changes: 34 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
#!/bin/bash

GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`
DATE=`date`
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"

BUILD_ROOT="redot-docs-build"
BUILD_DIR="$BUILD_ROOT/en/master"
LIVE_ROOT="redot-docs-live"
LIVE_REPO="[email protected]:Redot-Engine/$LIVE_ROOT.git"
BUILD_DIR="html/en/$GIT_BRANCH"

touch test.txt
echo 'hello' >> test.txt
echo "Live root: $LIVE_ROOT, live repo: $LIVE_REPO, build dir: $BUILD_DIR"

echo "Migrate Godot to Redot, options $1"
mkdir -p $MIGRATE_DIR
python migrate.py --tiny $INPUT_DIR $MIGRATE_DIR
python migrate.py $1 $INPUT_DIR $MIGRATE_DIR

echo "Translate to html"
mkdir -p $SPHINX_DIR
sphinx-build -b html -j 4 $MIGRATE_DIR $SPHINX_DIR

git clone [email protected]:Redot-Engine/$BUILD_ROOT.git
echo "Cloning $LIVE_REPO $REPO_DIR"
git clone $LIVE_REPO $REPO_DIR

echo "Checking out $GIT_LIVE_BRANCH"
cd $REPO_DIR
git checkout $GIT_LIVE_BRANCH
echo "mkdir -p $BUILD_DIR"
mkdir -p $BUILD_DIR
echo "cp -r $SPHINX_DIR/* $BUILD_DIR"
cp -r $SPHINX_DIR/* $BUILD_DIR

cp test.txt $BUILD_DIR
cp test.txt $BUILD_DIR/index.html
echo "cp -r ../$SPHINX_DIR/* $BUILD_DIR"
cp -r ../$SPHINX_DIR/* $BUILD_DIR

cd $BUILD_DIR
ls -la
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 "Delete temps"
rm -rf $MIGRATE_DIR
rm -rf $SPHINX_DIR
rm -rf $REPO_DIR

echo "Done. Made by @Craptain"

0 comments on commit 7af0817

Please sign in to comment.