Refactor service deployment + upload Compose files to the server #178

Merged
samsapti merged 24 commits from compose-files into main 2023-12-09 18:38:11 +00:00
Owner

As discussed with @valberg, we should upload the Compose files to the server in order to make things like upgrading services easier. To make this possible, and make things consistent, I've also converted single container services into compose stacks.

I have further refactored the service deployment logic to eliminate code duplication as much as possible, as many services follow the same pattern (create volume folder, upload Compose file, deploy service). Some services have additional tasks that can be included as pre-deployment tasks or post-deployment tasks with a file.

Closes #80.

As discussed with @valberg, we should upload the Compose files to the server in order to make things like upgrading services easier. To make this possible, and make things consistent, I've also converted single container services into compose stacks. I have further refactored the service deployment logic to eliminate code duplication as much as possible, as many services follow the same pattern (create volume folder, upload Compose file, deploy service). Some services have additional tasks that can be included as pre-deployment tasks or post-deployment tasks with a file. Closes #80.
samsapti added the
Refactor
label 2023-09-30 16:50:08 +00:00
valberg was assigned by samsapti 2023-09-30 16:50:08 +00:00
samsapti added 4 commits 2023-09-30 16:50:09 +00:00
valberg changed title from Move Compose stacks into Compose files and upload them to the server to WIP: Move Compose stacks into Compose files and upload them to the server 2023-09-30 20:29:01 +00:00
Owner

The docker-compose module in ansible uses docker compose v1. We should use the shell module to run the docker compose plugin (v2) using something like this https://stackoverflow.com/a/62453786

The `docker-compose` module in ansible uses docker compose v1. We should use the `shell` module to run the docker compose plugin (v2) using something like this https://stackoverflow.com/a/62453786
samsapti added 3 commits 2023-10-03 20:00:59 +00:00
samsapti changed title from WIP: Move Compose stacks into Compose files and upload them to the server to Move Compose stacks into Compose files and upload them to the server 2023-10-03 20:01:27 +00:00
samsapti added 1 commit 2023-10-03 20:13:36 +00:00
samsapti changed title from Move Compose stacks into Compose files and upload them to the server to WIP: Move Compose stacks into Compose files and upload them to the server 2023-10-04 16:50:32 +00:00
samsapti added 10 commits 2023-10-04 19:44:44 +00:00
samsapti changed title from WIP: Move Compose stacks into Compose files and upload them to the server to Refactor service deployment + upload Compose files to the server 2023-10-04 19:45:47 +00:00
valberg was unassigned by samsapti 2023-10-04 19:46:19 +00:00
samsapti requested review from valberg 2023-10-04 19:46:25 +00:00
Author
Owner

I have tested this in Vagrant. I have tested a full provisioning, and then I have tested deployment of a single service, with and without pre-/post-deployment tasks.

# full provisioning with Ansible
vagrant up 

# single service with pre-/post-deployment tasks
./deploy.sh --vagrant services mastodon

# single service without pre-/post-deployment tasks
./deploy.sh --vagrant services netdata

All tests finished with success.

I have tested this in Vagrant. I have tested a full provisioning, and then I have tested deployment of a single service, with and without pre-/post-deployment tasks. ```bash # full provisioning with Ansible vagrant up # single service with pre-/post-deployment tasks ./deploy.sh --vagrant services mastodon # single service without pre-/post-deployment tasks ./deploy.sh --vagrant services netdata ``` All tests finished with success.
samsapti added 1 commit 2023-10-04 20:02:17 +00:00
samsapti added 1 commit 2023-10-04 20:07:50 +00:00
samsapti added 1 commit 2023-11-04 00:21:01 +00:00
valberg approved these changes 2023-11-28 13:27:51 +00:00
Owner

Nice work @samsapti (as always!)

Nice work @samsapti (as always!)
samsapti added 1 commit 2023-12-07 19:40:20 +00:00
samsapti requested review from valberg 2023-12-07 19:43:08 +00:00
samsapti added 1 commit 2023-12-07 19:47:22 +00:00
valberg approved these changes 2023-12-07 20:47:19 +00:00
Owner

NICE! 🚀

NICE! 🚀
samsapti added 1 commit 2023-12-09 18:38:00 +00:00
samsapti merged commit c7289b4c5a into main 2023-12-09 18:38:11 +00:00
samsapti deleted branch compose-files 2023-12-09 18:38:12 +00:00
reynir reviewed 2023-12-11 11:36:44 +00:00
@ -140,3 +134,3 @@
vhs_website:
file: websites/vhs.data.coop.yaml
domain: vhs.data.coop
volume_folder: "{{ volume_website_folder }}/vhs"
Owner

hvad bruges det her til?

hvad bruges det her til?
Author
Owner

Til docker-compose.yml 🙂

Til `docker-compose.yml` 🙂
samsapti marked this conversation as resolved
Sign in to join this conversation.
No description provided.