diff --git a/.changeset/provisioner-angry-bikes-listen-2.md b/.changeset/provisioner-angry-bikes-listen-2.md new file mode 100644 index 000000000..893f52b4f --- /dev/null +++ b/.changeset/provisioner-angry-bikes-listen-2.md @@ -0,0 +1,5 @@ +--- +"provisioner": patch +--- + +fix: Improve deploy logic for bunq2ynab diff --git a/.changeset/provisioner-angry-bikes-listen.md b/.changeset/provisioner-angry-bikes-listen.md new file mode 100644 index 000000000..80d2acc10 --- /dev/null +++ b/.changeset/provisioner-angry-bikes-listen.md @@ -0,0 +1,5 @@ +--- +"provisioner": patch +--- + +fix: Loading remote tags for bunq2ynab diff --git a/provisioner/deploys/bunq2ynab/tasks/install_bunq2ynab.py b/provisioner/deploys/bunq2ynab/tasks/install_bunq2ynab.py index 08c51fb1d..3dc050ce6 100644 --- a/provisioner/deploys/bunq2ynab/tasks/install_bunq2ynab.py +++ b/provisioner/deploys/bunq2ynab/tasks/install_bunq2ynab.py @@ -32,7 +32,7 @@ def install_bunq2ynab(): "1password_service_account_token.credential" ) - docker_compose = files.template( + files.template( name="Copy the docker-compose file", src="provisioner/deploys/bunq2ynab/files/docker-compose.yml.j2", dest="/opt/bunq2ynab/docker-compose.yml", @@ -45,11 +45,10 @@ def install_bunq2ynab(): bunq2ynab_image_tag=host.data.bunq2ynab_image_tag, ) - if docker_compose.changed: - server.shell( - name="Start the bunq2ynab service", - commands=[ - "docker compose -f /opt/bunq2ynab/docker-compose.yml up -d --force-recreate --remove-orphans", - ], - _sudo=True, - ) + server.shell( + name="Start the bunq2ynab service", + commands=[ + "docker compose -f /opt/bunq2ynab/docker-compose.yml up -d --remove-orphans", + ], + _sudo=True, + ) diff --git a/provisioner/group_data/dev.py b/provisioner/group_data/dev.py index cfad086b4..b6515a127 100644 --- a/provisioner/group_data/dev.py +++ b/provisioner/group_data/dev.py @@ -1,3 +1,5 @@ +from pathlib import Path + setup_env = "dev" inside_docker = True legacy_ip_tables = True @@ -7,7 +9,7 @@ new_relic_display_name = "provisioner_dev" bunq2ynab_image_tag = ( "ghcr.io/vgijssel/setup/bunq2ynab-dev:" - + open("./tools/bunq2ynab/publish_oci_image-dev.remote_tags.txt", "r") - .read() + + Path("./tools/bunq2ynab/publish_oci_image-dev.remote_tags.txt") + .read_text() .strip() ) diff --git a/provisioner/group_data/prod.py b/provisioner/group_data/prod.py index 3c64f8bfd..6023620e4 100644 --- a/provisioner/group_data/prod.py +++ b/provisioner/group_data/prod.py @@ -1,3 +1,5 @@ +from pathlib import Path + setup_env = "prod" inside_docker = False legacy_ip_tables = False @@ -7,5 +9,5 @@ new_relic_display_name = "provisioner" bunq2ynab_image_tag = ( "ghcr.io/vgijssel/setup/bunq2ynab:" - + open("./tools/bunq2ynab/publish_oci_image.remote_tags.txt", "r").read().strip() + + Path("./tools/bunq2ynab/publish_oci_image.remote_tags.txt").read_text().strip() ) diff --git a/provisioner/group_data/test.py b/provisioner/group_data/test.py index ea4e27995..ed4978e70 100644 --- a/provisioner/group_data/test.py +++ b/provisioner/group_data/test.py @@ -1,3 +1,5 @@ +from pathlib import Path + setup_env = "test" inside_docker = True legacy_ip_tables = True @@ -7,7 +9,7 @@ new_relic_display_name = "provisioner_test" bunq2ynab_image_tag = ( "ghcr.io/vgijssel/setup/bunq2ynab-dev:" - + open("./tools/bunq2ynab/publish_oci_image-dev.remote_tags.txt", "r") - .read() + + Path("./tools/bunq2ynab/publish_oci_image-dev.remote_tags.txt") + .read_text() .strip() )