-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #689 from WPFerg/master
Release 10.0.0-rc.2 [Master]
- Loading branch information
Showing
9 changed files
with
77 additions
and
16 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
if ([ $TRAVIS_PULL_REQUEST == "false" ] && [ "${TRAVIS_REPO_SLUG}" == "ScottLogic/StockFlux" ] && ([ $TRAVIS_BRANCH == "dev" ] || [ $TRAVIS_BRANCH == "master" ])) | ||
then | ||
#Clone the latest gh-pages | ||
git clone https://github.com/ScottLogic/StockFlux.git --branch gh-pages gh-pages | ||
|
||
#Get line with version from the file -> get the second word -> remove quotes around the value | ||
VERSION=$(grep "version" package.json | awk -v N=$2 '{print $2}' | cut -d \" -f2) | ||
echo "Version is: $VERSION" | ||
|
||
#Get line with the release type (develop/master) from the file -> get the second word -> remove quotes around the value | ||
TYPE=$(grep "type" package.json | awk -v N=$2 '{print $2}' | cut -d \" -f2) | ||
echo "Type is: $TYPE" | ||
|
||
if ([ -z "$TYPE" ] || [ -z "$VERSION" ]) | ||
then | ||
echo "Version or Type not set in package.json" | ||
exit 1 | ||
fi | ||
|
||
rm -rf "./gh-pages/$TYPE" | ||
cp -r "./public" "./gh-pages/$TYPE" | ||
rm -rf "./gh-pages/$VERSION" | ||
cp -r "./public" "./gh-pages/$VERSION" | ||
cd gh-pages | ||
|
||
#Removing git history | ||
rm -rf .git | ||
git init | ||
|
||
# inside this git repo we'll pretend to be a new user | ||
git config user.name "Travis CI" | ||
git config user.email "[email protected]" | ||
|
||
# The first and only commit to this new Git repo contains all the | ||
# files present with the commit message "Deploy to GitHub Pages". | ||
git add . | ||
git commit -m "Deploy to GitHub Pages" | ||
|
||
# Force push from the current repo's master branch to the remote | ||
# repo's gh-pages branch. (All previous history on the gh-pages branch | ||
# will be lost, since we are overwriting it.) We redirect any output to | ||
# /dev/null to hide any sensitive credential data that might otherwise be exposed. | ||
echo "Pushing to: https://${GH_TOKEN}@${GH_REF}" | ||
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1 | ||
fi |
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
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