Reputation: 626
I have created a simple web-application using PHP, JS etc.. My next step is to deploy it to eg. liveserver.com
. I am sure that I will be providing a lot of additional features in the future and so I would like to know how this is generally done. I am pretty sure its a noob question so I tried to google it but nothing helpful came up.
Here is a rough idea on how I may do it. I would keep a local copy in WAMP and keep developing it and sync / push it to bitbucket. The question is : How do I connect the updated bitbucket version to my liveserver.com. I am keen to know how web-developers generally provide updates to their app users. Is there a general update mechanism they follow ? Is my idea of using a version control application wrong for this purpose ? How would you do it for a simple app like this ?
A concise answer would suffice. It would be great if anyone could provide me helpful links or point me to right direction, further information etc. TIA.
Upvotes: 1
Views: 48
Reputation: 6252
You're really asking two questions here:
The first question is answered here. The latter, broader question is touched on here but I'd like to offer my personal thoughts as well.
You've mentioned you're using WAMP, whereas I'm coming from a LAMP environment. Regardless, I'm hoping you will find some additional usefulness in my answer as it may help lead you to a Windows-based equivalent solution.
At home/work:
I also use bitbucket and prefer it to github. I have Git installed for source control which allows me to push or pull any code between bitbucket and my local machine.
On the go:
I have AWD IDE installed on my tablet which allows me FTP access to a production environment, and the non-free version also has Git integration. Another great IDE is Cloud 9; completely web-based and convenient if I don't have my tablet with me and need to use a public computer or laptop. Cloud 9 also supports Git.
Syncing:
Rather than push code from Bitbucket to my production server, I prefer to keep a mirror of my production server locally. I use a tool called rsync for this. I have a bash file setup on a cron job that looks something like this:
#!/bin/sh
RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
RUSER=remoteUser
RHOST=remoteHost
RPATH=/remote/path/
LPATH=/local/path/mirror/
$RSYNC -av --no-p --delete -O -e $SSH $RUSER@$RHOST:$RPATH $LPATH
So basically, my primary workstation (which is where I do most of my work) is always in sync with the live server. Both the live server and Bitbucket can be updated away from home. Thanks to Git, I can see exactly what has been modified. It's also comforting to know my code exists in three different places for redundancy.
This is what I have found to be most convenient for me, but I would love to know how others do it.
Upvotes: 1