Update push.sh
This commit is contained in:
@ -1,18 +1,32 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
setup_git() {
|
setup_git() {
|
||||||
git config --global user.email "mst10041967@gmail.com"
|
git config --global user.email "mst10041967@gmail.com"
|
||||||
git config --global user.name "Rohit Tanwar"
|
git config --global user.name "Rohit Tanwar"
|
||||||
}
|
}
|
||||||
|
|
||||||
commit_website_files() {
|
commit_website_files() {
|
||||||
git add -A
|
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then
|
||||||
|
if [ $TRAVIS_BRANCH == "master" ]; then
|
||||||
|
echo "Committing to master branch..."
|
||||||
|
git checkout master
|
||||||
|
git add *
|
||||||
|
if [ $TRAVIS_EVENT_TYPE == "cron" ]; then
|
||||||
|
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [cron]"
|
||||||
|
elif [ $TRAVIS_EVENT_TYPE == "api" ]; then
|
||||||
|
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [custom]"
|
||||||
|
else
|
||||||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER"
|
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
upload_files() {
|
upload_files() {
|
||||||
git remote add origin https://${GH_TOKEN}@github.com/kriadmin/30-seconds-of-python-code.git
|
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then
|
||||||
git push --quiet --set-upstream origin master
|
if [ $TRAVIS_BRANCH == "master" ]; then
|
||||||
|
echo "Pushing to master branch..."
|
||||||
|
git push --force --quiet "https://${GH_TOKEN}@github.com/kriadmin/30-seconds-of-python-code.git" master > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_git
|
setup_git
|
||||||
|
|||||||
Reference in New Issue
Block a user