Live data from Hacker News

Ask YC: How do you upload to your web server?

news.ycombinator.com

1–10 of 49 posts

Ask YC: How do you upload to your web server?

#1
Hi. I was wondering how you upload your code from localhost to the web server. Right now, for my project, I upload the entire directory from localhost to my web hosting server and replace the existing files with the newly uploaded files. It was ok in the beginning because the files were small. Now that I have a bunch of libraries, it takes quiet a long time to upload all 600 files every time I upload.

I recently learned about rsync to upload only changes. I was wondering if you use this or other tools to upload.

Re: Ask YC: How do you upload to your web server?

#4
i use mercurial, assuming your base directory is /www/pages (lighttpd), initially:

server: $ mkdir /www/pages/project $ cd /www/pages/project $ hg init

localhost: $ cd /path/to/your/project $ hg init $ hg add * $ hg commit -m "message" $ hg push ssh://usr:pwd@123.123.123.123//www/pages/project

afterward it's just the localhost (ignore "$ hg init")

Re: Ask YC: How do you upload to your web server?

#5

Are you using a repository to store your code? If so, you can check it out from the server and then copy it over.

Yes. I am using SVN to collaborate with my friends. How do you copy easily?

Commit your changes on your local machine then SSH to your server and do an svn update.

Re: Ask YC: How do you upload to your web server?

#6
post #4

i use mercurial, assuming your base directory is /www/pages (lighttpd), initially: server: $ mkdir /www/pages/project $ cd /www/pages/project $ hg init localhost: $ cd /path/to/your/project $ hg init $ hg add * $ hg commit -m "message" $ hg push ssh://usr:pwd@123.123.123.123//www/pages/project afterward it's just the localhost (ignore "$ hg init")

I agree that you need git or hg or svn or /something/ of the sort for large sites, like sangguine has, but for small/tiny sites, other options are available.

Heck, I use sshfs to mount my blog as a directory & edit files directly. rsync has also worked nicely for me in the past. But then, these are all sites that I either don't care about source control, or don't have git/hg available on the shared server.

Re: Ask YC: How do you upload to your web server?

#7
As others said, set up a repository for your code using a source control system, any one will do. Have a release branch and when updating it, make sure the server grabs it. The updating process can be automated using a check-in hook of some sorts.

Re: Ask YC: How do you upload to your web server?

#8
We use BZR for version control when we have a rep we arehappy to deploy

bzr push to a REP on the server login over ssh on the server bzr export REP run the test suite on the server (last check) cp relevant files to PROD restart the server (FastCGI)

everything automated and sequential one failure -> process stops completely (never happened so far)

Post reply on HN