Closed zarybnicky closed 3 years ago
@hnykda Nope, although given the shape of the server, I think an in-place "upgrade" should be a no-op. Might as well try for a trivial Ansible setup directly - docker(-compose) is trivial, but init-letsencrypt.sh seems to be circular, requiring 1) init-LE, 2) deploy, 3) init-LE, and then a final working deploy.sh IIRC, I'll try it out in a VM.
It seems like if you're used to the gcloud
CLI, hcloud
(https://github.com/hetznercloud/cli) isn't that far off...
Alright, @hnykda, the Ansible stuff is mostly experimental - right now it should be good for getting from a fresh server to a server ready to accept new deploys, but I obviously didn't test it with CircleCI.
But that shouldn't affect the GCloud->Hetzner stuff at all, that should've been ready before as well
Hey. Thanks for that. Looks good. What are the next steps to put it in production?
It seems like if you're used to the gcloud CLI, hcloud (https://github.com/hetznercloud/cli) isn't that far off...
Thanks, I personally don't really mind... It was just cleaner from gcloud perspective.
@hnykda Merge the PR, wait for CircleCI to deploy, migrate the DBs, check if hetzner.effectivethesis.org and beta.hetzner.effectivethesis.org work, switch the IPs in Cloudflare, decommission GCloud.
And hcloud ssh
and the entire CLI seems quite nice, might look into it. It's just that I'm not used to such niceties from work :)
OK, feel free to proceed. :+1:
Migration commands:
cd /var/server/efektivnialtruismus.cz
docker run --rm --volumes-from efektivnialtruismuscz_app_1 -v $(pwd):/backup busybox \
tar cvf /backup/app.tar /usr/src/app/data /usr/src/app/static /usr/src/app/media
sudo tar cvf certs.tar ./data/certbot/conf ./data/certbot/www
# beta rsync app.tar certs.tar root@159.69.217.7:/var/server/efektivnialtruismus.cz
# prod rsync app.tar certs.tar root@135.181.30.65:/var/server/efektivnialtruismus.cz
sudo rm *.tar
docker run --rm --volumes-from efektivnialtruismuscz_app_1 -v $(pwd):/backup busybox tar xvf /backup/app.tar
tar xvf certs.tar
And bin/beta.env + bin/master.env files, those were silent dependencies
I've prepared CircleCI for temporary parallel deployment to the old and the new servers. DNS is also ready, the new servers are accessible at hetzner.effectivethesis.org a beta.hetzner.effectivethesis.org.
Merging this shouldn't break deployment to the old servers, but should allow us to test the new ones, migrate the DBs, and then switch over by flipping the DNS records (almost instantly, due to using a CDN).