From 7acf7b06c3a2ac6f8242eab0de8619fa4b5a76f3 Mon Sep 17 00:00:00 2001 From: janskiba Date: Wed, 18 Dec 2024 10:53:37 +0000 Subject: [PATCH] dnpm: replace named volumes with fs volumes --- ccp/modules/dnpm-node-compose.yml | 11 +++-------- ccp/modules/dnpm-node-setup.sh | 1 + minimal/modules/dnpm-node-compose.yml | 11 +++-------- minimal/modules/dnpm-node-setup.sh | 1 + 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/ccp/modules/dnpm-node-compose.yml b/ccp/modules/dnpm-node-compose.yml index 6f85ca5..03df9f2 100644 --- a/ccp/modules/dnpm-node-compose.yml +++ b/ccp/modules/dnpm-node-compose.yml @@ -12,13 +12,13 @@ services: MYSQL_ROOT_HOST: "%" MYSQL_ROOT_PASSWORD: ${DNPM_MYSQL_ROOT_PASSWORD} volumes: - - dnpm-mysql:/var/lib/mysql + - /var/cache/bridgehead/dnpm/mysql:/var/lib/mysql dnpm-authup: image: authup/authup:latest container_name: bridgehead-dnpm-authup volumes: - - dnpm-authup:/usr/src/app/writable + - /var/cache/bridgehead/dnpm/authup:/usr/src/app/writable depends_on: dnpm-mysql: condition: service_healthy @@ -68,7 +68,7 @@ services: - AUTHUP_URL=robot://system:${DNPM_AUTHUP_SECRET}@http://dnpm-authup:3000 volumes: - /etc/bridgehead/dnpm/config:/dnpm_config - - dnpm-backend-data:/dnpm_data + - /var/cache/bridgehead/dnpm/backend-data:/dnpm_data depends_on: dnpm-authup: condition: service_healthy @@ -81,8 +81,3 @@ services: landing: labels: - "traefik.http.routers.landing.rule=PathPrefix(`/landing`)" - -volumes: - dnpm-authup: - dnpm-mysql: - dnpm-backend-data: diff --git a/ccp/modules/dnpm-node-setup.sh b/ccp/modules/dnpm-node-setup.sh index 2b1eb1b..4376909 100644 --- a/ccp/modules/dnpm-node-setup.sh +++ b/ccp/modules/dnpm-node-setup.sh @@ -9,6 +9,7 @@ if [ -n "${ENABLE_DNPM_NODE}" ]; then log ERROR "Mandatory variable ZPM_SITE not defined!" exit 1 fi + mkdir -p /var/cache/bridgehead/dnpm/ || fail_and_report 1 "Failed to create '/var/cache/bridgehead/dnpm/'. Please run sudo './bridgehead install $PROJECT' again to fix the permissions." DNPM_SYNTH_NUM=${DNPM_SYNTH_NUM:--1} DNPM_MYSQL_ROOT_PASSWORD="$(generate_simple_password 'dnpm mysql')" DNPM_AUTHUP_SECRET="$(generate_simple_password 'dnpm authup')" diff --git a/minimal/modules/dnpm-node-compose.yml b/minimal/modules/dnpm-node-compose.yml index 6f85ca5..03df9f2 100644 --- a/minimal/modules/dnpm-node-compose.yml +++ b/minimal/modules/dnpm-node-compose.yml @@ -12,13 +12,13 @@ services: MYSQL_ROOT_HOST: "%" MYSQL_ROOT_PASSWORD: ${DNPM_MYSQL_ROOT_PASSWORD} volumes: - - dnpm-mysql:/var/lib/mysql + - /var/cache/bridgehead/dnpm/mysql:/var/lib/mysql dnpm-authup: image: authup/authup:latest container_name: bridgehead-dnpm-authup volumes: - - dnpm-authup:/usr/src/app/writable + - /var/cache/bridgehead/dnpm/authup:/usr/src/app/writable depends_on: dnpm-mysql: condition: service_healthy @@ -68,7 +68,7 @@ services: - AUTHUP_URL=robot://system:${DNPM_AUTHUP_SECRET}@http://dnpm-authup:3000 volumes: - /etc/bridgehead/dnpm/config:/dnpm_config - - dnpm-backend-data:/dnpm_data + - /var/cache/bridgehead/dnpm/backend-data:/dnpm_data depends_on: dnpm-authup: condition: service_healthy @@ -81,8 +81,3 @@ services: landing: labels: - "traefik.http.routers.landing.rule=PathPrefix(`/landing`)" - -volumes: - dnpm-authup: - dnpm-mysql: - dnpm-backend-data: diff --git a/minimal/modules/dnpm-node-setup.sh b/minimal/modules/dnpm-node-setup.sh index 2b1eb1b..4376909 100644 --- a/minimal/modules/dnpm-node-setup.sh +++ b/minimal/modules/dnpm-node-setup.sh @@ -9,6 +9,7 @@ if [ -n "${ENABLE_DNPM_NODE}" ]; then log ERROR "Mandatory variable ZPM_SITE not defined!" exit 1 fi + mkdir -p /var/cache/bridgehead/dnpm/ || fail_and_report 1 "Failed to create '/var/cache/bridgehead/dnpm/'. Please run sudo './bridgehead install $PROJECT' again to fix the permissions." DNPM_SYNTH_NUM=${DNPM_SYNTH_NUM:--1} DNPM_MYSQL_ROOT_PASSWORD="$(generate_simple_password 'dnpm mysql')" DNPM_AUTHUP_SECRET="$(generate_simple_password 'dnpm authup')"