push.sh update

This commit is contained in:
Rohit Tanwar
2018-02-14 13:58:51 +05:30
parent d580748a48
commit 25db90dc2d

View File

@ -8,8 +8,9 @@ commit_website_files() {
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then
if [ $TRAVIS_BRANCH == "master" ]; then
echo "Committing to master branch..."
git checkout master
git add *
git add -A
echo "All files added"
git status
if [ $TRAVIS_EVENT_TYPE == "cron" ]; then
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [cron]"
elif [ $TRAVIS_EVENT_TYPE == "api" ]; then
@ -17,6 +18,8 @@ commit_website_files() {
else
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER"
fi
echo "Files commited"
git status
fi
fi
}
@ -25,7 +28,9 @@ upload_files() {
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then
if [ $TRAVIS_BRANCH == "master" ]; then
echo "Pushing to master branch..."
git push --force --quiet "https://${GH_TOKEN}@github.com/Chalarangelo/30-seconds-of-code.git" master > /dev/null 2>&1
git push --force "https://${GH_TOKEN}@github.com/Chalarangelo/30-seconds-of-code.git" master > /dev/null 2>&1
echo "Pushing done"
git status
fi
fi
}