Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid build failure if there is nothing new to push #406

Merged
merged 1 commit into from
Dec 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions scripts/update_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,19 @@ git submodule add -b gh-pages \
ghpages
cp -R docs/_build/html/* ghpages/
cd ghpages
# allow "git add" to fail if there aren't new files.
set +e
git add .
# Commit to gh-pages branch to apply changes.
git config user.name "selfiebot"
git commit -m "Update docs after merge to master."
git push \
"https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME}" \
HEAD:gh-pages
set -e
git status
# H/T: https://github.com/dhermes
if [[ -n "$(git status --porcelain)" ]]; then
# Commit to gh-pages branch to apply changes.
git config user.name "selfiebot"
git commit -m "Update docs after merge to master."
git push \
"https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME}" \
HEAD:gh-pages
else
echo "Nothing to commit. Exiting without pushing changes."
fi
17 changes: 13 additions & 4 deletions scripts/update_wheels_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,18 @@ echo "${TRAVIS_COMMIT}" > ${FRESH_REPO_DIR}/LATEST_COMMIT
# Display git status and push LATEST_COMMIT. #
##############################################
cd ${FRESH_REPO_DIR}
git add LATEST_COMMIT

# allow "git add" to fail if there aren't new files.
# this can happen if we re-run builds on travis.
set +e
git add LATEST_COMMIT
set -e
git status
git commit -m "Main project gcloud-python has been updated."
git status
git push origin master
# H/T: https://github.com/dhermes
if [[ -n "$(git status --porcelain)" ]]; then
git commit -m "Main project gcloud-python has been updated."
git status
git push origin master
else
echo "Nothing to commit. Exiting without pushing changes."
fi