Skip to content

Commit

Permalink
Merge branch 'main' into feat/weight-list
Browse files Browse the repository at this point in the history
  • Loading branch information
Lealefoulon committed Dec 17, 2024
2 parents 1de7225 + 5c55af9 commit 23cadc6
Show file tree
Hide file tree
Showing 62 changed files with 2,758 additions and 2,299 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ APP_EUDONET_PARIS_BASE_URL=https://eudonet-partage.apps.paris.fr
APP_BAC_IDF_DECREES_FILE=data/bac_idf/decrees.json
APP_BAC_IDF_CITIES_FILE=data/bac_idf/cities.csv
DATABASE_URL="postgresql://dialog:dialog@database:5432/dialog"
METABASE_DATABASE_URL="postgresql://dialog:dialog@database:5432/dialog"
REDIS_URL="redis://redis:6379"
API_ADRESSE_BASE_URL=https://api-adresse.data.gouv.fr
APP_IGN_GEOCODER_BASE_URL=https://data.geopf.fr
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
run: |
echo "DATABASE_URL=postgresql://dialog:dialog@localhost:5432/dialog" >> .env
echo "BDTOPO_DATABASE_URL=${{ secrets.BDTOPO_DATABASE_URL }}" >> .env
echo "METABASE_DATABASE_URL=postgresql://dialog:dialog@localhost:5432/dialog" >> .env
echo "REDIS_URL=redis://localhost:6379" >> .env
echo "APP_STORAGE_SOURCE=memory.storage" >> .env
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/metabase_export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
run: |
ssh-keyscan -H ssh.osc-fr1.scalingo.com >> ~/.ssh/known_hosts
- name: Init CI environment variables
run: |
echo "DATABASE_URL=${{ secrets.METABASE_EXPORT_DATABASE_URL }}" >> .env
echo "METABASE_DATABASE_URL=${{ secrets.METABASE_EXPORT_METABASE_DATABASE_URL }}" >> .env
- name: Run export
run: make ci_metabase_export
env:
METABASE_SRC_APP: ${{ vars.METABASE_EXPORT_SRC_APP }}
METABASE_SRC_DATABASE_URL: ${{ secrets.METABASE_EXPORT_SRC_DATABASE_URL }}
METABASE_DEST_APP: ${{ vars.METABASE_EXPORT_DEST_APP }}
METABASE_DEST_DATABASE_URL: ${{ secrets.METABASE_EXPORT_DEST_DATABASE_URL }}
40 changes: 40 additions & 0 deletions .github/workflows/metabase_migrate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Metabase Migrate

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'src/Infrastructure/Persistence/Doctrine/MetabaseMigrations/**'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Init environment variables
run: |
echo "METABASE_DATABASE_URL=${{ secrets.METABASE_MIGRATIONS_METABASE_DATABASE_URL }}" >> .env
- name: CI
run: make ci_metabase_migrate BIN_COMPOSER="composer" BIN_CONSOLE="php bin/console"
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ dbinstall: ## Setup databases
make data_install
make console CMD="doctrine:database:create --env=test --if-not-exists"
make dbmigrate ARGS="--env=test"
make metabase_migrate ARGS="--env=test"
make data_install ARGS="--env=test"
make dbfixtures

Expand Down Expand Up @@ -107,6 +108,12 @@ bdtopo_migrate_redo: ## Revert db migrations for bdtopo and run them again
# Re-run migrations from there
make bdtopo_migrate

metabase_migration: ## Generate new migration for metabase
${BIN_CONSOLE} doctrine:migrations:generate --configuration ./config/packages/metabase/doctrine_migrations.yaml

metabase_migrate: ## Run db migrations for metabase
${BIN_CONSOLE} doctrine:migrations:migrate -n --all-or-nothing --configuration ./config/packages/metabase/doctrine_migrations.yaml ${ARGS}

dbshell: ## Connect to the database
docker compose exec database psql postgresql://dialog:dialog@database:5432/dialog

Expand Down Expand Up @@ -280,10 +287,14 @@ ci_bdtopo_migrate: ## Run CI steps for BD TOPO Migrate workflow
make composer CMD="install -n --prefer-dist"
make bdtopo_migrate

ci_metabase_migrate: ## Run CI steps for Metabase Migrate workflow
make composer CMD="install -n --prefer-dist"
make metabase_migrate

ci_metabase_export: ## Export data to Metabase
scalingo login --ssh --ssh-identity ~/.ssh/id_rsa
./tools/scalingodbtunnel ${METABASE_DEST_APP} --host-url --port 10001 & ./tools/wait-for-it.sh 127.0.0.1:10001
./tools/metabase-export.sh ${METABASE_SRC_DATABASE_URL} ${METABASE_DEST_DATABASE_URL}
./tools/scalingodbtunnel dialog-metabase --host-url --port 10001 & ./tools/wait-for-it.sh 127.0.0.1:10001
make console CMD="app:metabase:export"

##
## ----------------
Expand Down
54 changes: 27 additions & 27 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@
"martin-georgiev/postgresql-for-doctrine": "^2.6",
"nelmio/security-bundle": "^3.0",
"sentry/sentry-symfony": "^4.5",
"symfony/asset": "7.1.*",
"symfony/console": "7.1.*",
"symfony/dotenv": "7.1.*",
"symfony/expression-language": "7.1.*",
"symfony/filesystem": "7.1.*",
"symfony/asset": "7.2.*",
"symfony/console": "7.2.*",
"symfony/dotenv": "7.2.*",
"symfony/expression-language": "7.2.*",
"symfony/filesystem": "7.2.*",
"symfony/flex": "^2",
"symfony/form": "7.1.*",
"symfony/framework-bundle": "7.1.*",
"symfony/http-client": "7.1.*",
"symfony/lock": "7.1.*",
"symfony/messenger": "7.1.*",
"symfony/mime": "7.1.*",
"symfony/form": "7.2.*",
"symfony/framework-bundle": "7.2.*",
"symfony/http-client": "7.2.*",
"symfony/lock": "7.2.*",
"symfony/messenger": "7.2.*",
"symfony/mime": "7.2.*",
"symfony/monolog-bundle": "^3.8",
"symfony/rate-limiter": "7.1.*",
"symfony/runtime": "7.1.*",
"symfony/security-bundle": "7.1.*",
"symfony/translation": "7.1.*",
"symfony/twig-bundle": "7.1.*",
"symfony/uid": "7.1.*",
"symfony/rate-limiter": "7.2.*",
"symfony/runtime": "7.2.*",
"symfony/security-bundle": "7.2.*",
"symfony/translation": "7.2.*",
"symfony/twig-bundle": "7.2.*",
"symfony/uid": "7.2.*",
"symfony/ux-turbo": "^2.7",
"symfony/validator": "7.1.*",
"symfony/validator": "7.2.*",
"symfony/webpack-encore-bundle": "^2.1",
"symfony/yaml": "7.1.*",
"symfony/yaml": "7.2.*",
"twig/extra-bundle": "^3.6",
"twig/markdown-extra": "^3.8",
"twig/string-extra": "^3.6",
Expand All @@ -54,14 +54,14 @@
"friendsofphp/php-cs-fixer": "^3.13",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9.5",
"symfony/browser-kit": "7.1.*",
"symfony/css-selector": "7.1.*",
"symfony/debug-bundle": "7.1.*",
"symfony/password-hasher": "7.1.*",
"symfony/browser-kit": "7.2.*",
"symfony/css-selector": "7.2.*",
"symfony/debug-bundle": "7.2.*",
"symfony/password-hasher": "7.2.*",
"symfony/phpunit-bridge": "^6.3",
"symfony/stopwatch": "7.1.*",
"symfony/var-dumper": "7.1.*",
"symfony/web-profiler-bundle": "7.1.*"
"symfony/stopwatch": "7.2.*",
"symfony/var-dumper": "7.2.*",
"symfony/web-profiler-bundle": "7.2.*"
},
"config": {
"allow-plugins": {
Expand Down Expand Up @@ -113,7 +113,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "7.1.*"
"require": "7.2.*"
},
"paas": {
"php-config": [
Expand Down
Loading

0 comments on commit 23cadc6

Please sign in to comment.