I have a VPS (OS: centos/debian) now. What I want is to develop my own website (RoR/python) and write some functional programs like parser, email sever and so on. What I am doing now is to write code and use ftp to push my code then use the root shell (which is lag and slow) on vps to run and debug. This is killing me. Can anyone tell me how to deal with this? And use what to replace the root shell?
Asked
Active
Viewed 2,323 times
1
-
Have you tried setting up git on vps and git pull [publish branch] instead of ftp? – Farrukh Subhani Apr 26 '17 at 10:48
-
@FarrukhSubhani I have no concept on that, will have a look – Zanecola Apr 26 '17 at 10:50
1 Answers
2
Try this.
- On your VPS install git
- Clone your repo and checkout a branch called production or something like that
- On your dev machine commit all code you want to deploy
- Merge it into production branch
- Login to VPS and cd into folder you cloned in step 2
- git pull should bring in all changes from git on production branch
All this can be automated but if you try this with a simple html file you will understand the process and feel comfortable doing gulp or grunt based automation of each step. Ideally you can have a task runner on development machine that will run deploy task and ssh to your vps, change directory to your git folder and pull changes, may have to stash existing changes and also backup last version somewhere else and run database migration if needed etc. But dont worry about all of this at this stage.

Farrukh Subhani
- 2,018
- 1
- 17
- 25
-
-
-
You can try various options listed here http://stackoverflow.com/questions/243750/how-can-i-automate-running-commands-remotely-over-ssh but dont replace ssh just learn to automate through it. – Farrukh Subhani Apr 27 '17 at 10:11