This repository has been archived by the owner on May 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
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
6 changed files
with
82 additions
and
12 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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
DIST_BRANCH='gh-pages' | ||
DIST_OUT='out/client' | ||
|
||
GIT_REPO_ROOT=$(git rev-parse --show-toplevel) | ||
if [ "$GIT_REPO_ROOT" != "$PWD" ]; then | ||
echo "Should run this script in the repository root"; | ||
exit 1; | ||
fi | ||
|
||
GIT_BRANCH_NAME=$(git symbolic-ref HEAD 2>/dev/null) | ||
if [ "$GIT_BRANCH_NAME" != "refs/heads/master" ]; then | ||
echo "Should checkout master branch"; | ||
exit 1; | ||
fi | ||
|
||
if [[ -n $(git status -s) ]]; then | ||
echo "Should be clean"; | ||
exit 1; | ||
fi | ||
|
||
if [[ -n $(git log origin/master..master) ]]; then | ||
echo "Should be pushed to master"; | ||
exit 1; | ||
fi | ||
|
||
# Update remote commits | ||
git remote update | ||
|
||
# Get hash | ||
LAST_HASH=$(git rev-parse HEAD) | ||
|
||
echo "Commit $LAST_HASH will be distributed" | ||
|
||
# Check out to dist branch | ||
git checkout $DIST_BRANCH | ||
|
||
# Rebase against master | ||
git rebase master | ||
|
||
# Reset to last commit | ||
git reset --hard $LAST_HASH | ||
|
||
# Build | ||
npm run build | ||
|
||
# Add built files | ||
git add $DIST_OUT | ||
|
||
# Commit | ||
git commit -am "Built" | ||
|
||
# Push | ||
git push -f | ||
|
||
# Back to master | ||
git checkout master | ||
|
||
echo "FINISHED" |
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
Empty file.
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
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
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