Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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
Add Comment
Please, Sign In to add comment