Skip to content

Commit

Permalink
Refactor database naming
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanLouisLamezec committed Aug 21, 2024
1 parent bcd4ac6 commit 1a05517
Show file tree
Hide file tree
Showing 38 changed files with 61 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/angers_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '0 5 * * *'

env:
DBNAME_PROD: ${{ secrets.ANGERS_DBNAME_PROD }}
DBNAME: ${{ secrets.ANGERS_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cese_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '0 8 * * *'

env:
DBNAME_PROD: ${{ secrets.CESE_DBNAME_PROD }}
DBNAME: ${{ secrets.CESE_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cour_des_comptes_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '0 8 * * *'

env:
DBNAME_PROD: ${{ secrets.COUR_DES_COMPTES_DBNAME_PROD }}
DBNAME: ${{ secrets.COUR_DES_COMPTES_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/demo_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '30 9 * * *'

env:
DBNAME_PROD: ${{ secrets.DEMO_DBNAME_PROD }}
DBNAME: ${{ secrets.DEMO_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Configure db name and participation host name
run: |
echo "DBNAME_DEV=${{ secrets[env.DB_SECRET_NAME] }}" >> $GITHUB_ENV
echo "DBNAME=${{ secrets[env.DB_SECRET_NAME] }}" >> $GITHUB_ENV
echo "PARTICIPATION_HOST_NAME=${{ secrets[env.PARTICIPATION_HOST_NAME] }}" >> $GITHUB_ENV
- name: Run dbt test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/grand_nancy_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '30 6 * * *'

env:
DBNAME_PROD: ${{ secrets.GRAND_NANCY_DBNAME_PROD }}
DBNAME: ${{ secrets.GRAND_NANCY_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lyon_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '0 5 * * *'

env:
DBNAME_PROD: ${{ secrets.LYON_DBNAME_PROD }}
DBNAME: ${{ secrets.LYON_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/marseille_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '30 7 * * *'

env:
DBNAME_PROD: ${{ secrets.MARSEILLE_DBNAME_PROD }}
DBNAME: ${{ secrets.MARSEILLE_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sytral_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '30 7 * * *'

env:
DBNAME_PROD: ${{ secrets.SYTRAL_DBNAME_PROD }}
DBNAME: ${{ secrets.SYTRAL_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/thionville_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '30 7 * * *'

env:
DBNAME_PROD: ${{ secrets.THIONVILLE_DBNAME_PROD }}
DBNAME: ${{ secrets.THIONVILLE_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/toulouse_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '0 5 * * *'

env:
DBNAME_PROD: ${{ secrets.TOULOUSE_DBNAME_PROD }}
DBNAME: ${{ secrets.TOULOUSE_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tours_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '0 8 * * *'

env:
DBNAME_PROD: ${{ secrets.TOURS_DBNAME_PROD }}
DBNAME: ${{ secrets.TOURS_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/valbonne_models_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '0 5 * * *'

env:
DBNAME_PROD: ${{ secrets.valbonne_DBNAME_PROD }}
DBNAME: ${{ secrets.valbonne_DBNAME_PROD }}
HOST: ${{ secrets.HOST }}
PASSWORD: ${{ secrets.PASSWORD }}
PORT: ${{ secrets.PORT }}
Expand Down
3 changes: 2 additions & 1 deletion projects/angers/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"

vars:
vars:
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('PARTICIPATION_HOST_NAME') }}"

# Configuring models
Expand Down
4 changes: 2 additions & 2 deletions projects/angers/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ angers:
target: dev
outputs:
dev:
dbname: "{{ env_var('DBNAME_DEV') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand All @@ -11,7 +11,7 @@ angers:
type: postgres
user: "{{ env_var('USER') }}"
prod:
dbname: "{{ env_var('DBNAME_PROD') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand Down
1 change: 1 addition & 0 deletions projects/cese/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ clean-targets: # directories to be removed by `dbt clean`
- "dbt_packages"

vars:
dbname: "{{ env_var('DBNAME') }}"
target_schema: "{{ env_var('TARGET_SCHEMA') }}"
host: "{{ env_var('PARTICIPATION_HOST_NAME') }}"

Expand Down
4 changes: 2 additions & 2 deletions projects/cese/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cese:
target: dev
outputs:
dev:
dbname: "{{ env_var('DBNAME_DEV') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand All @@ -11,7 +11,7 @@ cese:
type: postgres
user: "{{ env_var('USER') }}"
prod:
dbname: "{{ env_var('DBNAME_PROD') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand Down
3 changes: 2 additions & 1 deletion projects/cour_des_comptes/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"

vars:
vars:
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('PARTICIPATION_HOST_NAME') }}"

# Configuring models
Expand Down
4 changes: 2 additions & 2 deletions projects/cour_des_comptes/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cour_des_comptes:
target: dev
outputs:
dev:
dbname: "{{ env_var('DBNAME_DEV') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand All @@ -11,7 +11,7 @@ cour_des_comptes:
type: postgres
user: "{{ env_var('USER') }}"
prod:
dbname: "{{ env_var('DBNAME_PROD') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand Down
2 changes: 1 addition & 1 deletion projects/demo/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DBNAME_DEV=
DBNAME=
HOST=
PASSWORD=
PORT=
Expand Down
1 change: 1 addition & 0 deletions projects/demo/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ clean-targets: # directories to be removed by `dbt clean`
- "dbt_packages"

vars:
dbname: "{{ env_var('DBNAME') }}"
target_schema: "{{ env_var('TARGET_SCHEMA') }}"
host: "{{ env_var('PARTICIPATION_HOST_NAME') }}"

Expand Down
7 changes: 3 additions & 4 deletions projects/demo/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ demo:
target: dev
outputs:
dev:
dbname: "{{ env_var('DBNAME_DEV') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand All @@ -11,12 +11,11 @@ demo:
type: postgres
user: "{{ env_var('USER') }}"
prod:
dbname: "{{ env_var('DBNAME_PROD') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
schema: "{{ env_var('TARGET_SCHEMA') }}"
threads: 1
type: postgres
user: "{{ env_var('USER') }}"

user: "{{ env_var('USER') }}"
3 changes: 2 additions & 1 deletion projects/grand_nancy/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"

vars:
vars:
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('PARTICIPATION_HOST_NAME') }}"

# Configuring models
Expand Down
4 changes: 2 additions & 2 deletions projects/grand_nancy/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ grand_nancy:
target: dev
outputs:
dev:
dbname: "{{ env_var('DBNAME_DEV') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand All @@ -11,7 +11,7 @@ grand_nancy:
type: postgres
user: "{{ env_var('USER') }}"
prod:
dbname: "{{ env_var('DBNAME_PROD') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand Down
3 changes: 2 additions & 1 deletion projects/lyon/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"

vars:
vars:
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('PARTICIPATION_HOST_NAME') }}"

# Configuring models
Expand Down
4 changes: 2 additions & 2 deletions projects/lyon/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lyon:
target: dev
outputs:
dev:
dbname: "{{ env_var('DBNAME_DEV') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand All @@ -11,7 +11,7 @@ lyon:
type: postgres
user: "{{ env_var('USER') }}"
prod:
dbname: "{{ env_var('DBNAME_PROD') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand Down
3 changes: 2 additions & 1 deletion projects/marseille/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"

vars:
vars:
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('PARTICIPATION_HOST_NAME') }}"

# Configuring models
Expand Down
4 changes: 2 additions & 2 deletions projects/marseille/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ marseille:
target: dev
outputs:
dev:
dbname: "{{ env_var('DBNAME_DEV') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand All @@ -11,7 +11,7 @@ marseille:
type: postgres
user: "{{ env_var('USER') }}"
prod:
dbname: "{{ env_var('DBNAME_PROD') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand Down
3 changes: 2 additions & 1 deletion projects/sytral/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"

vars:
vars:
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('PARTICIPATION_HOST_NAME') }}"

# Configuring models
Expand Down
4 changes: 2 additions & 2 deletions projects/sytral/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sytral:
target: dev
outputs:
dev:
dbname: "{{ env_var('DBNAME_DEV') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand All @@ -11,7 +11,7 @@ sytral:
type: postgres
user: "{{ env_var('USER') }}"
prod:
dbname: "{{ env_var('DBNAME_PROD') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand Down
3 changes: 2 additions & 1 deletion projects/thionville/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"

vars:
vars:
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('PARTICIPATION_HOST_NAME') }}"

# Configuring models
Expand Down
4 changes: 2 additions & 2 deletions projects/thionville/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ thionville:
target: dev
outputs:
dev:
dbname: "{{ env_var('DBNAME_DEV') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand All @@ -11,7 +11,7 @@ thionville:
type: postgres
user: "{{ env_var('USER') }}"
prod:
dbname: "{{ env_var('DBNAME_PROD') }}"
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('HOST') }}"
pass: "{{ env_var('PASSWORD') }}"
port: "{{ env_var('PORT') | as_number }}"
Expand Down
3 changes: 2 additions & 1 deletion projects/toulouse/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"

vars:
vars:
dbname: "{{ env_var('DBNAME') }}"
host: "{{ env_var('PARTICIPATION_HOST_NAME') }}"

# Configuring models
Expand Down
Loading

0 comments on commit 1a05517

Please sign in to comment.