rename functions in deploy.sh because I'm pedantic.
@@ -8,29 +8,29 @@ echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
# Only act if this is build was fired from a push to master.
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ -z "${TRAVIS_TAG}" ] && [ "${TRAVIS_BRANCH}" = "master" ] && [ -n "${gh_bot_token+isset}" ]
then
- # Configure git user.
- setup_git() {
+ # Configure git.
+ git_config() {
git config --global user.email "deploy@travis-ci.org"
git config --global user.name "Deployment Bot"
}
- # Commit all changes to local production branch.
- commit_all_files() {
+ # Commit any changes to local production branch.
+ git_commit() {
git checkout -b production
git add -A
git commit --message "Travis Build: ${TRAVIS_BUILD_NUMBER}" || :
}
- # Push changes to remote production branch.
- push_files() {
+ # Push to remote production branch.
+ git_push() {
git remote rm origin
git remote add origin https://WikipediaLibraryBot:${gh_bot_token}@github.com/WikipediaLibrary/TWLight.git > /dev/null 2>&1
git push --quiet --set-upstream origin production && echo "Build pushed to production."
}
- setup_git
- commit_all_files
- push_files
+ git_config
+ git_commit
+ git_push
else
echo "Doesn't meet conditions for deployment. Skipping push to production."
fi
