From 8437218a974fea8edcfe691d959b749a7ad58d05 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 12:36:01 -0500 Subject: [PATCH 01/12] Adding restart true for services dependent on mariadb. --- docker-compose.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index d9dc4511..694ce1ad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1706,6 +1706,7 @@ services: mariadb: condition: service_started required: true + restart: true environment: APP_ADMIN_EMAIL: charish.patel@trez.wtf APP_ADMIN_PASSWORD: ${HORTUSFOX_ADMIN_PASSWORD} @@ -3311,6 +3312,11 @@ services: volume: {} nextcloud: container_name: nextcloud + depends_on: + mariadb: + condition: service_healthy + required: true + restart: true environment: PGID: 1000 PUID: 1000 @@ -3423,6 +3429,11 @@ services: type: bind paperless-ngx: container_name: paperless-ngx + depends_on: + mariadb: + condition: service_healthy + required: true + restart: true environment: PAPERLESS_DBENGINE: mariadb PAPERLESS_DBHOST: mariadb @@ -6072,6 +6083,7 @@ services: mariadb: condition: service_started required: true + restart: true redis: condition: service_started required: true From 52bd1fa698038702212a8f99484ca0b2922d24ea Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 12:42:52 -0500 Subject: [PATCH 02/12] Adding restart true for services dependent on mariadb. --- docker-compose.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 694ce1ad..ddf442bf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -556,7 +556,10 @@ services: castopod: container_name: castopod depends_on: - - mariadb + mariadb: + condition: service_healthy + required: true + restart: true environment: MYSQL_DATABASE: castopod MYSQL_USER: castopod @@ -1704,7 +1707,7 @@ services: container_name: hortusfox depends_on: mariadb: - condition: service_started + condition: service_healthy required: true restart: true environment: @@ -3027,6 +3030,11 @@ services: PUID: 1000 TZ: America/New_York MYSQL_PASSWORD: VQU23wHKRNmfpAPt5E9BxMaSGJdWjLuz + healthcheck: + test: "/usr/bin/mariadb -u root -p${MARIADB_ENVIRONMENT_MYSQL_ROOT_PASSWORD} -e \"SHOW DATABASES;\"" + interval: 10s + timeout: 5s + retries: 3 hostname: Rinoa image: ghcr.io/linuxserver/mariadb networks: @@ -6081,7 +6089,7 @@ services: container_name: wallabag depends_on: mariadb: - condition: service_started + condition: service_healthy required: true restart: true redis: From 669ee23ee97c7091430157fb4c709d6dfffc270d Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 13:08:33 -0500 Subject: [PATCH 03/12] . --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 963d3687..cf283a21 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -28,7 +28,7 @@ jobs: tea login default gitea-rinoa echo "Checking if PR exists for ${{ github.ref_name }}" tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state - tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep -q '${{ gitea.ref_name }}' + tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep -q '${{ github.ref_name }}' if [ $? -eq 0 ]; then echo "PR exists, checking state..." pr_state=$(tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep '${{ github.ref_name }}' | awk -F',' '{print $4}') From a7060535cc4b46aaad168c458327dada1e73701b Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 13:10:19 -0500 Subject: [PATCH 04/12] . --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index cf283a21..a9ac5b8b 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -31,7 +31,7 @@ jobs: tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep -q '${{ github.ref_name }}' if [ $? -eq 0 ]; then echo "PR exists, checking state..." - pr_state=$(tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep '${{ github.ref_name }}' | awk -F',' '{print $4}') + pr_state=$(tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep '${{ github.ref_name }}' | awk -F',' '{print $4}' | sed -e 's|"||g') if [ "${pr_state}" != 'open' ]; then echo "PR does not exist, creating..." tea pr c -r "${{ github.repository }}" -t "Automated PR for ${{ github.ref_name }}" -d "Automated PR for ${{ github.ref_name }}" From 3554cde9e411227e4d8d92edf856fefe5a37bff0 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 13:11:58 -0500 Subject: [PATCH 05/12] . --- .gitea/workflows/deployment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index a9ac5b8b..a0b06451 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -32,6 +32,7 @@ jobs: if [ $? -eq 0 ]; then echo "PR exists, checking state..." pr_state=$(tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep '${{ github.ref_name }}' | awk -F',' '{print $4}' | sed -e 's|"||g') + echo "PR state: ${pr_state}" if [ "${pr_state}" != 'open' ]; then echo "PR does not exist, creating..." tea pr c -r "${{ github.repository }}" -t "Automated PR for ${{ github.ref_name }}" -d "Automated PR for ${{ github.ref_name }}" From caa15ed4eee987620fa274149e577cd79aba67c8 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 13:15:44 -0500 Subject: [PATCH 06/12] . --- .gitea/workflows/deployment.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index a0b06451..d4611aa0 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -26,12 +26,11 @@ jobs: run: | tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} tea login default gitea-rinoa - echo "Checking if PR exists for ${{ github.ref_name }}" - tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state + echo "Checking if PR exists for ${{ github.ref_name }}..." tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep -q '${{ github.ref_name }}' if [ $? -eq 0 ]; then echo "PR exists, checking state..." - pr_state=$(tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep '${{ github.ref_name }}' | awk -F',' '{print $4}' | sed -e 's|"||g') + pr_state=$(tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep '${{ github.ref_name }}' | head -1 | awk -F',' '{print $4}' | sed -e 's|"||g') echo "PR state: ${pr_state}" if [ "${pr_state}" != 'open' ]; then echo "PR does not exist, creating..." From 01b4f585240db16772e40bd1dd8a99122fe99649 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 13:21:18 -0500 Subject: [PATCH 07/12] .. --- .gitea/workflows/deployment.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index d4611aa0..e1ba0340 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -27,19 +27,11 @@ jobs: tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} tea login default gitea-rinoa echo "Checking if PR exists for ${{ github.ref_name }}..." - tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep -q '${{ github.ref_name }}' + tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep '${{ github.ref_name }}' | head -1 | egrep 'open' if [ $? -eq 0 ]; then - echo "PR exists, checking state..." - pr_state=$(tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep '${{ github.ref_name }}' | head -1 | awk -F',' '{print $4}' | sed -e 's|"||g') - echo "PR state: ${pr_state}" - if [ "${pr_state}" != 'open' ]; then - echo "PR does not exist, creating..." - tea pr c -r "${{ github.repository }}" -t "Automated PR for ${{ github.ref_name }}" -d "Automated PR for ${{ github.ref_name }}" - elif [ "${pr_state}" = 'open' ]; then - echo "PR already exists, skipping creation..." - fi + echo "An open PR exists, skipping creation..." elif [ $? -eq 1 ]; then - echo "PR does not exist, creating..." + echo "No open PRs, creating one..." tea pr c -r "${{ github.repository }}" -t "Automated PR for ${{ github.ref_name }}" -d "Automated PR for ${{ github.ref_name }}" fi From 55c8b72940323185e78dd014260fc885efccf779 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 13:25:27 -0500 Subject: [PATCH 08/12] .. --- .gitea/workflows/deployment.yml | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index e1ba0340..53365087 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -27,7 +27,7 @@ jobs: tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} tea login default gitea-rinoa echo "Checking if PR exists for ${{ github.ref_name }}..." - tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep '${{ github.ref_name }}' | head -1 | egrep 'open' + tea pr ls --repo ${{ github.repository }} --state all --fields index,title,head,state --output csv | egrep '${{ github.ref_name }}' | head -1 | egrep -q 'open' if [ $? -eq 0 ]; then echo "An open PR exists, skipping creation..." elif [ $? -eq 1 ]; then diff --git a/docker-compose.yml b/docker-compose.yml index ddf442bf..216c57d1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3031,7 +3031,7 @@ services: TZ: America/New_York MYSQL_PASSWORD: VQU23wHKRNmfpAPt5E9BxMaSGJdWjLuz healthcheck: - test: "/usr/bin/mariadb -u root -p${MARIADB_ENVIRONMENT_MYSQL_ROOT_PASSWORD} -e \"SHOW DATABASES;\"" + test: /usr/bin/mariadb -u root -p${MARIADB_ENVIRONMENT_MYSQL_ROOT_PASSWORD} -e "SHOW DATABASES;" interval: 10s timeout: 5s retries: 3 From 3eabf1a3d41f77244d1f3ef03c2735a47791a079 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 13:29:55 -0500 Subject: [PATCH 09/12] .. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 216c57d1..137f8f92 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3031,7 +3031,7 @@ services: TZ: America/New_York MYSQL_PASSWORD: VQU23wHKRNmfpAPt5E9BxMaSGJdWjLuz healthcheck: - test: /usr/bin/mariadb -u root -p${MARIADB_ENVIRONMENT_MYSQL_ROOT_PASSWORD} -e "SHOW DATABASES;" + test: [ "CMD", "/usr/bin/mariadb", "-u", "root", "-p${MARIADB_ENVIRONMENT_MYSQL_ROOT_PASSWORD}", "-e", "\"SHOW DATABASES;\"" ] interval: 10s timeout: 5s retries: 3 From 06780b1a427b768151be37dd04e9da45f1930b96 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 13:35:19 -0500 Subject: [PATCH 10/12] .. --- docker-compose.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 137f8f92..0593d444 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -557,7 +557,7 @@ services: container_name: castopod depends_on: mariadb: - condition: service_healthy + condition: service_started required: true restart: true environment: @@ -1707,7 +1707,7 @@ services: container_name: hortusfox depends_on: mariadb: - condition: service_healthy + condition: service_started required: true restart: true environment: @@ -1872,6 +1872,11 @@ services: create_host_path: true invoice_ninja: container_name: invoice_ninja + depends_on: + mariadb: + condition: service_started + required: true + restart: true environment: APP_DEBUG: true APP_KEY: ${IN_APP_KEY} @@ -3439,7 +3444,7 @@ services: container_name: paperless-ngx depends_on: mariadb: - condition: service_healthy + condition: service_started required: true restart: true environment: @@ -6089,7 +6094,7 @@ services: container_name: wallabag depends_on: mariadb: - condition: service_healthy + condition: service_started required: true restart: true redis: From 332aef1b895ee8bbd0139aa898826e9d68190325 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 13:37:29 -0500 Subject: [PATCH 11/12] ... --- docker-compose.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0593d444..8b317cb5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3035,11 +3035,6 @@ services: PUID: 1000 TZ: America/New_York MYSQL_PASSWORD: VQU23wHKRNmfpAPt5E9BxMaSGJdWjLuz - healthcheck: - test: [ "CMD", "/usr/bin/mariadb", "-u", "root", "-p${MARIADB_ENVIRONMENT_MYSQL_ROOT_PASSWORD}", "-e", "\"SHOW DATABASES;\"" ] - interval: 10s - timeout: 5s - retries: 3 hostname: Rinoa image: ghcr.io/linuxserver/mariadb networks: From a255ff7932c98e0b61b78fbab6e4b484055c4ec6 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 14 Jan 2025 13:40:17 -0500 Subject: [PATCH 12/12] ... --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8b317cb5..60867c13 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3322,7 +3322,7 @@ services: container_name: nextcloud depends_on: mariadb: - condition: service_healthy + condition: service_started required: true restart: true environment: