Skip to content

Commit 545bd70

Browse files
committed
Auto-sync dbt_project.yml profile with generated profiles.yml
- setup-project.sh now automatically updates dbt_project.yml profile name - This prevents profile mismatches between dbt_project.yml and profiles-docker.yml - Simplified user experience - just use project name, no need to worry about profile sync - Updated documentation to reflect this automatic synchronization
1 parent 9c1f08c commit 545bd70

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,8 @@ cd your-new-project
269269
./setup-project.sh finance-demo
270270
./setup-project.sh uae-licenses us-west-2
271271

272-
# ⚠️ dbt Profile Note: If using dbt, ensure project name matches your profile
273-
# For profile 'uaeme-licenses-mxcp' → use: ./setup-project.sh uaeme-licenses
274-
# For profile 'vertec-mxcp' → use: ./setup-project.sh vertec
272+
# ℹ️ dbt Integration: The script automatically updates dbt_project.yml
273+
# to use profile '{{PROJECT_NAME}}-mxcp' matching the generated profiles.yml
275274
```
276275

277276
#### Manual Setup (Step by Step)
@@ -454,10 +453,8 @@ Replace with your project name (e.g., "uae-licenses", "finance-demo"):
454453
sed -i "s/{{PROJECT_NAME}}/your-project/g" justfile
455454
```
456455

457-
> **⚠️ Important for dbt users**: The `{{PROJECT_NAME}}` is used to generate the dbt profile name as `{{PROJECT_NAME}}-mxcp` in `profiles-docker.yml`.
458-
> Make sure this matches the profile name in your `dbt_project.yml`:
459-
> - If `dbt_project.yml` has `profile: uaeme-licenses-mxcp`, use PROJECT_NAME="uaeme-licenses"
460-
> - If `dbt_project.yml` has `profile: vertec-mxcp`, use PROJECT_NAME="vertec"
456+
> **ℹ️ dbt Integration**: The setup script automatically creates a dbt profile named `{{PROJECT_NAME}}-mxcp`
457+
> and updates your `dbt_project.yml` to match. No manual synchronization needed!
461458
462459
#### **{{DATA_DOWNLOAD_COMMAND}}**
463460
Replace with your data download command:

setup-project.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,19 @@ fi
197197
if safe_copy "deployment/profiles-docker.yml.template" "deployment/profiles-docker.yml" "dbt profiles"; then
198198
sed -i "s/{{PROJECT_NAME}}/$PROJECT_NAME/g; s/{{AWS_REGION}}/$AWS_REGION/g" deployment/profiles-docker.yml
199199
print_success "Created deployment/profiles-docker.yml"
200+
201+
# If dbt_project.yml exists, update the profile name to match
202+
if [ -f "dbt_project.yml" ]; then
203+
print_info "Found dbt_project.yml - updating profile name to match..."
204+
# Create the new profile name
205+
NEW_PROFILE="${PROJECT_NAME}-mxcp"
206+
# Update the profile line in dbt_project.yml
207+
if sed -i "s/^profile:.*/profile: $NEW_PROFILE/" dbt_project.yml; then
208+
print_success "Updated dbt_project.yml profile to: $NEW_PROFILE"
209+
else
210+
print_warning "Could not update dbt_project.yml - please manually set profile: $NEW_PROFILE"
211+
fi
212+
fi
200213
fi
201214

202215
# Copy MXCP user configuration

0 commit comments

Comments
 (0)