Skip to content

Commit

Permalink
ghp
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot Nahman committed Jul 26, 2017
1 parent 97dbbf4 commit c131220
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions scripts/ghp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ GIT_COMMIT_MESSAGE="[Travis] Rebuild documentation for Github Pages"
# Check if we should run a deploy, or if we should skip it. Only commits to master
# should trigger a build. Pull requests and commits to features branches should not.
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
# if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "Skipping deploy; just doing a build."
exit 0
fi
Expand All @@ -43,21 +42,21 @@ rm -rf css
rm -rf sass
rm -rf scripts
rm -rf test
rm *.html
rm *.json
rm *.enc
rm *.js
rm *.png
rm *.lock
rm *.ico
rm *.md
rm *.pdf
rm -f *.html
rm -f *.json
rm -f *.enc
rm -f *.js
rm -f *.png
rm -f *.lock
rm -f *.ico
rm -f *.md
rm -f *.pdf
yes | rm .travis.yml
rm .bowerrc
rm .editorconfig
rm -f .bowerrc
rm -f .editorconfig
rm -rf .github
rm .gitignore
rm .jshintrc
rm -f .gitignore
rm -f .jshintrc

# force installation of bower packages at the root
echo "{ \"directory\": \".\" }" > .bowerrc
Expand All @@ -80,7 +79,7 @@ echo ${meta_temp/'COMPONENT_NAME'/$REPO_NAME} > index.html
npm install bower -g
bower cache clean
# Install the repo and the dark-theme.
bower install ${REPO_NAME} px-dark-theme px-dark-demo-theme
bower install ${REPO_NAME} px-dark-theme px-dark-demo-theme --force-latest

#copy the bower file into our root
yes | cp ${REPO_NAME}/bower.json bower.json
Expand Down Expand Up @@ -114,8 +113,10 @@ bower install
# checkout a new orphan
git checkout --orphan $TARGET_BRANCH

git add -A .
git commit -m "${GIT_COMMIT_MESSAGE}"
git add -A . > /dev/null
echo "git add done"
git commit -m "${GIT_COMMIT_MESSAGE}" --quiet
echo "git commit done"

# Set git credentials (defined in settings above)
git config user.name ${GIT_USER_NAME}
Expand All @@ -140,11 +141,8 @@ chmod 0400 $TRAVIS_BUILD_DIR/deploy_key

# Push to predix-ui/repo `gh-pages` branch (force to override out-of-date refs)
ssh-add $TRAVIS_BUILD_DIR/deploy_key

echo $SSH_GIT_PREDIXUI

git push $SSH_GIT_PREDIXUI $TARGET_BRANCH --force

sleep 120s

curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${cloudflare_zone_identifier}/purge_cache" -H "X-Auth-Email: martin.wragg@ge.com" -H "X-Auth-Key: ${cloudflare}" -H "Content-Type: application/json" --data '{"purge_everything":true}'
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${cloudflare_zone_identifier}/purge_cache" -H "X-Auth-Email: martin.wragg@ge.com" -H "X-Auth-Key: ${cloudflare}" -H "Content-Type: application/json" --data '{"purge_everything":true}'

0 comments on commit c131220

Please sign in to comment.