Created
November 29, 2017 18:55
-
-
Save ammist/f7e1c2ca5f1ed8371f14596cafe91ce6 to your computer and use it in GitHub Desktop.
Deploy with Rsync
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/sh | |
#whatever your SSH key is that you need to get the data from bitbucket and/or push to your environment. | |
ssh-add ~/.ssh/id_rsa | |
rm -rf projectname | |
git clone git@bitbucket.org:teamname/projectnamee.git projectname | |
cd projectname | |
#switch to whatever branch you have your code in | |
git checkout production | |
#clean up files you dont want on your webserver. | |
rm -rf .git | |
cd .. | |
# To Upload/Import | |
rsync -rlvz --size-only --ipv4 --progress -e 'ssh -p 2222' projectname --temp-dir=~/tmp/ servername.domain.tld:path/to/projectname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment