diff --git a/build.sh b/build.sh index 8a02d58..5a7ba64 100755 --- a/build.sh +++ b/build.sh @@ -209,6 +209,8 @@ modules_need_rebuild(){ local storage_path storage_path="$(read_env STORAGE_PATH_LOCAL "./local-storage")" if [[ "$storage_path" != /* ]]; then + # Remove leading ./ if present + storage_path="${storage_path#./}" storage_path="$ROOT_DIR/$storage_path" fi local sentinel="$storage_path/modules/.requires_rebuild" @@ -380,6 +382,8 @@ stage_modules(){ local local_storage_path local_storage_path="$(read_env STORAGE_PATH_LOCAL "./local-storage")" if [[ "$local_storage_path" != /* ]]; then + # Remove leading ./ if present + local_storage_path="${local_storage_path#./}" local_storage_path="$ROOT_DIR/$local_storage_path" fi export LOCAL_STORAGE_SENTINEL_PATH="$local_storage_path/modules/.requires_rebuild" @@ -566,6 +570,8 @@ main(){ local storage_path storage_path="$(read_env STORAGE_PATH_LOCAL "./local-storage")" if [[ "$storage_path" != /* ]]; then + # Remove leading ./ if present + storage_path="${storage_path#./}" storage_path="$ROOT_DIR/$storage_path" fi local sentinel="$storage_path/modules/.requires_rebuild" diff --git a/deploy.sh b/deploy.sh index 9f3bc99..5d9328a 100755 --- a/deploy.sh +++ b/deploy.sh @@ -191,10 +191,15 @@ mark_deployment_complete(){ local storage_path storage_path="$(read_env STORAGE_PATH_LOCAL "./local-storage")" if [[ "$storage_path" != /* ]]; then + # Remove leading ./ if present + storage_path="${storage_path#./}" storage_path="$ROOT_DIR/$storage_path" fi local sentinel="$storage_path/modules/.last_deployed" - mkdir -p "$(dirname "$sentinel")" + if ! mkdir -p "$(dirname "$sentinel")" 2>/dev/null; then + warn "Cannot create local-storage directory. Deployment tracking may not work properly." + return 0 + fi date > "$sentinel" } @@ -202,6 +207,8 @@ modules_need_rebuild(){ local storage_path storage_path="$(read_env STORAGE_PATH_LOCAL "./local-storage")" if [[ "$storage_path" != /* ]]; then + # Remove leading ./ if present + storage_path="${storage_path#./}" storage_path="$ROOT_DIR/$storage_path" fi local sentinel="$storage_path/modules/.requires_rebuild" diff --git a/scripts/migrate-stack.sh b/scripts/migrate-stack.sh index 5e9247b..256cfbe 100755 --- a/scripts/migrate-stack.sh +++ b/scripts/migrate-stack.sh @@ -163,6 +163,9 @@ setup_remote_repository(){ exit 1 fi + # Create local-storage directory structure + run_ssh "mkdir -p '$PROJECT_DIR/local-storage/modules'" + echo " • Repository synchronized ✓" } diff --git a/scripts/rebuild-with-modules.sh b/scripts/rebuild-with-modules.sh index 977a090..7b047e3 100755 --- a/scripts/rebuild-with-modules.sh +++ b/scripts/rebuild-with-modules.sh @@ -131,6 +131,8 @@ fi # Build sentinel is tracked in local storage LOCAL_STORAGE_PATH="$(read_env STORAGE_PATH_LOCAL "./local-storage")" if [[ "$LOCAL_STORAGE_PATH" != /* ]]; then + # Remove leading ./ if present + LOCAL_STORAGE_PATH="${LOCAL_STORAGE_PATH#./}" LOCAL_STORAGE_PATH="$PROJECT_DIR/$LOCAL_STORAGE_PATH" fi MODULES_DIR="$STORAGE_PATH/modules" diff --git a/scripts/stage-modules.sh b/scripts/stage-modules.sh index 88acc5a..532223d 100755 --- a/scripts/stage-modules.sh +++ b/scripts/stage-modules.sh @@ -102,6 +102,8 @@ MODULES_DIR="$STORAGE_PATH/modules" # Build sentinel is in local storage, deployment modules are in shared storage LOCAL_STORAGE_PATH="$(read_env STORAGE_PATH_LOCAL "./local-storage")" if [[ "$LOCAL_STORAGE_PATH" != /* ]]; then + # Remove leading ./ if present + LOCAL_STORAGE_PATH="${LOCAL_STORAGE_PATH#./}" LOCAL_STORAGE_PATH="$PROJECT_DIR/$LOCAL_STORAGE_PATH" fi SENTINEL_FILE="$LOCAL_STORAGE_PATH/modules/.requires_rebuild" diff --git a/verify-deployment.sh b/verify-deployment.sh index 0f3e05f..a1802c0 100755 --- a/verify-deployment.sh +++ b/verify-deployment.sh @@ -100,6 +100,8 @@ handle_auto_rebuild(){ local storage_path storage_path="$(read_env_value STORAGE_PATH_LOCAL "./local-storage")" if [[ "$storage_path" != /* ]]; then + # Remove leading ./ if present + storage_path="${storage_path#./}" storage_path="$(dirname "$COMPOSE_FILE")/$storage_path" fi local sentinel="$storage_path/modules/.requires_rebuild"