Guest User

Untitled

a guest
Jul 18th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. //add your EC2 .pem file to ssh kys
  2. ssh-add ~/aws/mypemfile.pem
  3.  
  4. //create bare repo on AWS EC2 webserver and deploy on demand
  5. mkdir ~/git/the_project
  6. cd ~/git/the_project
  7. git init --bare
  8.  
  9. //create local repo and track remote one
  10. cd ~/git/the_project
  11. git init
  12. git add .
  13. git commit -m "Initial git commit message"
  14. git remote add aws ubuntu@1.1.1.1:~/git/the_project
  15. git config --global remote.origin.receivepack "git receive-pack"
  16. git push aws master
  17. //create tag
  18. git tag -a v0.1 -m "my version 0.1"
  19. //push tags
  20. git push aws --tags
  21.  
  22. //Or you have one so you push your updates
  23. git remote add aws ubuntu@1.1.1.1:~/git/the_project
  24. git config --global remote.origin.receivepack "git receive-pack"
  25. git push aws master
  26. //create tag
  27. git tag -a v0.1 -m "my version 0.1"
  28. //push tags
  29. git push aws --tags
  30.  
  31. //on server create another local repo that track the bare one to deploy
  32. git clone ~/git/the_project
  33. cd ./the_project
  34. //checkout tag
  35. git checkout v0.1
  36. //install clear cache ...
  37. npm install
Add Comment
Please, Sign In to add comment