Created
July 18, 2018 06:07
-
-
Save eslam-mahmoud/35777e4382599438023abefc9786a382 to your computer and use it in GitHub Desktop.
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
//add your EC2 .pem file to ssh kys | |
ssh-add ~/aws/mypemfile.pem | |
//create bare repo on AWS EC2 webserver and deploy on demand | |
mkdir ~/git/the_project | |
cd ~/git/the_project | |
git init --bare | |
//create local repo and track remote one | |
cd ~/git/the_project | |
git init | |
git add . | |
git commit -m "Initial git commit message" | |
git remote add aws ubuntu@1.1.1.1:~/git/the_project | |
git config --global remote.origin.receivepack "git receive-pack" | |
git push aws master | |
//create tag | |
git tag -a v0.1 -m "my version 0.1" | |
//push tags | |
git push aws --tags | |
//Or you have one so you push your updates | |
git remote add aws ubuntu@1.1.1.1:~/git/the_project | |
git config --global remote.origin.receivepack "git receive-pack" | |
git push aws master | |
//create tag | |
git tag -a v0.1 -m "my version 0.1" | |
//push tags | |
git push aws --tags | |
//on server create another local repo that track the bare one to deploy | |
git clone ~/git/the_project | |
cd ./the_project | |
//checkout tag | |
git checkout v0.1 | |
//install clear cache ... | |
npm install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment