Created
August 19, 2009 08:17
-
-
Save astashov/170245 to your computer and use it in GitHub Desktop.
Creates/synchronizes new repo in the same parent dir with submodules tracked in the main tree and push the repo to Heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
current_dir=`pwd` | |
heroku_dir="${current_dir}_heroku" | |
function rsync_repo { | |
# Add trailing slash to source directory to avoid recreating it into $heroku_dir | |
rsync -r --exclude .git/ ${current_dir}/ $heroku_dir | |
} | |
# If $heroku_dir is directory and existed directory | |
if [ -d $heroku_dir ]; then | |
rsync_repo | |
cd $heroku_dir | |
git add . | |
git ci -m "Another commit" | |
git push heroku master | |
else | |
mkdir $heroku_dir | |
rsync_repo | |
cd $heroku_dir | |
git init | |
git add . | |
git ci -m "Initial commit" | |
heroku create | |
git push heroku master | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment