Skip to content

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

Comments

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?

All the time! We use PHP, so each request is a blank slate -- persistent state is all in mysql, redis and memcached. DB schemas are pushed/applied before the code that uses them. Also if it wasn't clear: all those steps are automated, other than running the "I want trunk on prod now" script. We really should make that a post-test hook. Any year now ;-)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.