Live data from Hacker News

Ask HN: how do you stage/push your code?

news.ycombinator.com

1–10 of 16 posts

Re: Ask HN: how do you stage/push your code?

#2
I have a simple setup for my pet projects: 1. Push code in github 2. Run fab deploy (fabric)

Fabric pull the code from github, puts it in the server and restarts the services (mongo, nginx) if needed.

I took some inspiration from newblur's fabfile.py: https://github.com/samuelclay/NewsBlur/blob/master/fabfile.p...

Re: Ask HN: how do you stage/push your code?

#3
After all 40,000 unit tests have passed, sync that version to prod with ssh tunnel. Rsync to new directory on all target machines in a rsync tree. Switch to new version by moving a symlink. Verify new version by looking at metrics -- if something is off, automatically switch back. Repeat up to 50 times a day ;-)

Re: Ask HN: how do you stage/push your code?

#4
post #2

I have a simple setup for my pet projects: 1. Push code in github 2. Run fab deploy (fabric) Fabric pull the code from github, puts it in the server and restarts the services (mongo, nginx) if needed. I took some inspiration from newblur's fabfile.py: https://github.com/samuelclay/NewsBlur/blob/master/fabfile.p...

That's a pretty big fabfile! Do you do anything special with your DB as you switch over?

Re: Ask HN: how do you stage/push your code?

#5
We have a staging server which is a carbon copy of the production server, and is auto-updated via post-commit hook (SVN). Everybody tests on that server until no more issues are found, and then it is pushed manually to production.

If the push involves db schema changes, we'll take the production offline for the duration of the push, showing a "Be back shortly" page.

Re: Ask HN: how do you stage/push your code?

#6
post #3

After all 40,000 unit tests have passed, sync that version to prod with ssh tunnel. Rsync to new directory on all target machines in a rsync tree. Switch to new version by moving a symlink. Verify new version by looking at metrics -- if something is off, automatically switch back. Repeat up to 50 times a day ;-)

Have you had to deal with users with sessions across multiple versions?

Re: Ask HN: how do you stage/push your code?

#7
The shop I just moved to has the usual roll-your-own mess, but the shop I just left did it right: "yum update". Making RPMs isn't hard, and it ensures appropriate versions of all dependencies are there (even stuff like syslog-ng configs), and their tiny overworked sysadmin team didn't have to know or care which language they're implemented in, or whether there's anything smuggled onto each box behind their backs, or how to bring a freshly-imaged box into production. They ran a small script to fake a health check failure on a few servers at a time to do it without load, because they didn't want to reserve the footprint to run two versions of an app server in parallel on each box.
Post reply on HN