From 4411698e9b37b9f56ae1c92b3abf277f84c69f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Tue, 28 Oct 2025 23:27:33 +0100 Subject: [PATCH] fix: source .env file before executing import scripts Added 'set -a && source .env && set +a' at the beginning of import scripts to load environment variables from .env file. This ensures DB_USER and SEXY_DB_NAME are properly set before executing docker commands, regardless of whether arty exports them or not. - set -a: enables automatic export of variables - source .env: loads variables from .env file - set +a: disables automatic export --- arty.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arty.yml b/arty.yml index d48fa9d..4eda77f 100644 --- a/arty.yml +++ b/arty.yml @@ -109,6 +109,7 @@ scripts: # Import PostgreSQL database from SQL dump # WARNING: This will DROP existing tables if they exist (uses --clean --if-exists) sexy/db/import: | + set -a && source .env && set +a && echo "⚠️ WARNING: This will replace the current database!" && echo "Make sure core_postgres container is running..." && docker exec -i core_postgres psql -U $DB_USER -d $SEXY_DB_NAME < ~/Projects/docker-compose/sexy/directus.sql && @@ -132,6 +133,7 @@ scripts: # Step 1: Import database (drops/recreates all tables) # Step 2: Apply schema (updates Directus metadata) sexy/import/all: | + set -a && source .env && set +a && echo "⚠️ WARNING: This will completely replace the database and schema!" && echo "Importing database..." && docker exec -i core_postgres psql -U $DB_USER -d $SEXY_DB_NAME < ~/Projects/docker-compose/sexy/directus.sql &&