News for hackers. Stuff that matters.
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by bootwoot on Tuesday October 12, 2021 @09:21AM (#28839309)
This is great. Until you need to roll back.
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by qw on Tuesday October 12, 2021 @10:03AM (#28839784)
I had a similar setup a couple of years ago, where I had to deploy without downtime. My solution was to simply have the old version running in parallel until I was certain the new version was ok

----------

Static website:

1. Setup NginX using a symlink to the current version

2. Copy the new files to a separate folder

3. Change the symlink to point to the new version

----------

REST service (behind NgninX reverse proxy):

1. Current version runs on port X.

2. Deploy new version and run it on port Y.

3. Update NginX config to use port Y and reload

4. If you need rollback, just reverse step 3.

This can be done using scripts or Ansible too if necessary.

Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by brightball on Tuesday October 12, 2021 @09:25AM (#28839343)
Keep a simple tool like Ansible around for those spooky admin tricks and you can take advantage of the Ansistrano plugins for smooth deploy and rollback (Ruby's great Capistrano tool ported to Ansible).

https://ansistrano.com/

It's pretty fantastic.

Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by 1MachineElf on Tuesday October 12, 2021 @09:35AM (#28839472)
This looks awesome. I'm currently in the middle of learning Ansible now for my FjeeBSD jails. Have any other plugins to recommend?
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by brightball on Tuesday October 12, 2021 @09:37AM (#28839479)
Anything by geerlingguy on Ansible Galaxy.
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by lenova on Tuesday October 12, 2021 @11:17AM (#28840768)
> Anything by geerlingguy on Ansible Galaxy.

I've been writing some Ansible playbooks recently for the first time in years, and came upon geerlingguy's work. That guy is a powerhouse when it comes to writing Ansible roles/modules!

Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by geerlingguy on Wednesday October 13, 2021 @02:15PM (#28855499)
Why, thanks ;)
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by bkanber on Tuesday October 12, 2021 @09:56AM (#28839698)

    git checkout abcd1234
    ./build.sh && ./deploy.sh

I don't see the issue.
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by dsgrillo on Tuesday October 12, 2021 @10:41AM (#28840300)
If you have any migration, you probably want to rollback them as well
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by mrweasel on Tuesday October 12, 2021 @11:23AM (#28840856)
That's sort of pet peeve of mine: Migration are done separate from code deploys. Version 1 of your code runs on schema version 1. Schema version 2 does not make chances that will break code version 1. Code version 2 can utilize the chances made in schema version 2, but you're still able to rollback the code.

Each schema migration should also come with its own rollback script.

The downside is that you might need three migrations for some operation, but at least you won't break stuff.

The assumption that you can do a schema migration while deploying new code is only valid when you have very limited database sizes. I've seen Flyway migrations break so many times, because developers assumed it was fine to just do complicated migrations on a 200GB database. Or a Django database migration just lock up everything for hours because no one cared to think about the difference between migrating 100MB and 100GB. And I've never seen anyone seriously considering rolling back a Flyway migration.

Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by spfzero on Tuesday October 12, 2021 @12:06PM (#28841398)
Agree with this and have practiced and advocated for it. Make the schema changes to support the new feature first, then verify existing software still works. Deploy the schema change. Then develop the new feature, test, and deploy the program. That way you can deploy and rollback without needing to synchronously run a bunch of migration routines.
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by marcosdumay on Tuesday October 12, 2021 @09:43AM (#28839546)
Why? Checkout what version you want to roll back to, and deploy it.
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by thujlife on Tuesday October 12, 2021 @09:25AM (#28839352)
rollback.sh