From d68154f8ec1ae3a9eecef1388a4f8714fac27b4e Mon Sep 17 00:00:00 2001 From: Stephan D Date: Fri, 7 Nov 2025 02:57:23 +0100 Subject: [PATCH] fixed db lock --- ci/prod/compose/db.yml | 8 ++++---- ci/prod/scripts/deploy-db.sh | 1 + ci/prod/scripts/lock-db.sh | 7 +++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ci/prod/compose/db.yml b/ci/prod/compose/db.yml index fc6f574..b7049b1 100644 --- a/ci/prod/compose/db.yml +++ b/ci/prod/compose/db.yml @@ -48,7 +48,7 @@ services: sendico_db1: <<: *common-env - image: ${REGISTRY_URL}/mirror/mongo:${MONGO_TAG}@${MONGO_DIGEST} + image: ${MONGO_IMAGE} container_name: sendico_db1 restart: unless-stopped depends_on: { vault-agent-sendico: { condition: service_healthy } } @@ -70,7 +70,7 @@ services: sendico_db2: <<: *common-env - image: ${REGISTRY_URL}/mirror/mongo:${MONGO_TAG}@${MONGO_DIGEST} + image: ${MONGO_IMAGE} container_name: sendico_db2 restart: unless-stopped depends_on: { vault-agent-sendico: { condition: service_healthy } } @@ -91,7 +91,7 @@ services: sendico_db3: <<: *common-env - image: ${REGISTRY_URL}/mirror/mongo:${MONGO_TAG}@${MONGO_DIGEST} + image: ${MONGO_IMAGE} container_name: sendico_db3 restart: unless-stopped depends_on: { vault-agent-sendico: { condition: service_healthy } } @@ -112,7 +112,7 @@ services: mongo_setup: <<: *common-env - image: ${REGISTRY_URL}/mirror/mongo:${MONGO_TAG}@${MONGO_DIGEST} + image: ${MONGO_IMAGE} depends_on: sendico_db1: { condition: service_healthy } sendico_db2: { condition: service_healthy } diff --git a/ci/prod/scripts/deploy-db.sh b/ci/prod/scripts/deploy-db.sh index b4f0be7..31efaae 100755 --- a/ci/prod/scripts/deploy-db.sh +++ b/ci/prod/scripts/deploy-db.sh @@ -23,6 +23,7 @@ ssh -o StrictHostKeyChecking=no "$REMOTE_TARGET" REMOTE_DIR="$REMOTE_DIR" <<'EOS . ../env/.env.lock.db export REGISTRY_USER="$(cat ../env/.env.registry.user)" export REGISTRY_PASS="$(cat ../env/.env.registry.pass)" + mkdir -p ~/.docker echo "${REGISTRY_PASS}" | docker login "${REGISTRY_URL}" --username "${REGISTRY_USER}" --password-stdin >/dev/null set +a docker compose -f db.yml pull diff --git a/ci/prod/scripts/lock-db.sh b/ci/prod/scripts/lock-db.sh index f3ffa50..06d3c25 100644 --- a/ci/prod/scripts/lock-db.sh +++ b/ci/prod/scripts/lock-db.sh @@ -54,5 +54,8 @@ if [ -z "$DIGEST" ]; then exit 1 fi -printf 'MONGO_TAG=%s\nMONGO_DIGEST=%s\n' "$APP_V" "$DIGEST" | tee .env.lock ci/prod/env/.env.lock.db -cat .env.lock +cat <