-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/fs-isolation
- Loading branch information
Showing
12 changed files
with
66 additions
and
61 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,30 @@ | ||
{ | ||
"name": "aplus", | ||
"stack": "scalingo-20", | ||
"env": { | ||
"STAGING_DATABASE_URL": { | ||
"required": true | ||
}, | ||
"APP_DOMAIN": { | ||
"required": true | ||
}, | ||
"APP_HTTPS": { | ||
"required": true | ||
"APP_HOST": { | ||
"generator": "template", | ||
"template": "%APP%.osc-fr1.scalingo.io" | ||
}, | ||
"APPLICATION_SECRET": { | ||
"required": true | ||
}, | ||
"EVOLUTIONS_AUTOAPPLY": { | ||
"required": true | ||
}, | ||
"MAIL_HOST": { | ||
"required": true | ||
}, | ||
"MAIL_PASSWORD": { | ||
"required": true | ||
}, | ||
"MAIL_PORT": { | ||
"required": true | ||
}, | ||
"MAIL_USER": { | ||
"required": true | ||
"generator": "secret" | ||
}, | ||
"SENTRY_DSN": { | ||
"required": true | ||
}, | ||
"AREAS_WITH_LOGIN_BY_KEY": { | ||
"required": true | ||
}, | ||
"AREAS_WITH_ATTACHEMENTS": { | ||
"required": true | ||
}, | ||
"FILES_PATH": { | ||
"required": true | ||
"IS_REVIEW_APP": { | ||
"value": "true" | ||
} | ||
}, | ||
"formation": { | ||
"web": { | ||
"quantity": 1 | ||
"amount": 1, | ||
"size": "S" | ||
} | ||
}, | ||
"addons": [ | ||
"heroku-postgresql" | ||
], | ||
"buildpacks": [ | ||
{ | ||
"url": "heroku/nodejs" | ||
}, | ||
{ | ||
"url": "heroku/scala" | ||
"plan": "postgresql:postgresql-sandbox" | ||
} | ||
] | ||
], | ||
"scripts": { | ||
"postdeploy": "bash scripts/copy-scalingo-review-app-db.sh" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
-- !Ups | ||
--- !Ups | ||
|
||
ALTER TABLE user_group ADD is_in_france_services_network BOOLEAN NOT NULL DEFAULT true; | ||
ALTER TABLE application ADD is_in_france_services_network BOOLEAN NOT NULL DEFAULT true; | ||
UPDATE organisation SET short_name = 'France Travail' WHERE id = 'Pôle emploi'; | ||
UPDATE organisation SET name = 'France Travail' WHERE id = 'Pôle emploi'; | ||
|
||
|
||
-- !Downs | ||
|
||
ALTER TABLE application DROP is_in_france_services_network; | ||
ALTER TABLE user_group DROP is_in_france_services_network; | ||
--- !Downs | ||
|
||
UPDATE organisation SET name = 'Pôle emploi' WHERE id = 'Pôle emploi'; | ||
UPDATE organisation SET short_name = 'Pôle emploi' WHERE id = 'Pôle emploi'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- !Ups | ||
|
||
ALTER TABLE user_group ADD is_in_france_services_network BOOLEAN NOT NULL DEFAULT true; | ||
ALTER TABLE application ADD is_in_france_services_network BOOLEAN NOT NULL DEFAULT true; | ||
|
||
|
||
-- !Downs | ||
|
||
ALTER TABLE application DROP is_in_france_services_network; | ||
ALTER TABLE user_group DROP is_in_france_services_network; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
echo "Running Scalingo review app DB copy script" | ||
|
||
if [ "$IS_REVIEW_APP" = "true" ]; then | ||
dbclient-fetcher pgsql 15 | ||
|
||
echo "Copying review app db" | ||
|
||
echo "Checking number of rows in 'user' table" | ||
|
||
USER_COUNT=$(/app/bin/psql "${SCALINGO_POSTGRESQL_URL}" -A -t -c 'SELECT COUNT(*) FROM "user";') | ||
|
||
if [ "$USER_COUNT" -gt 0 ] 2>/dev/null; then | ||
echo "Table 'user' has $USER_COUNT rows. Doing nothing." | ||
else | ||
echo "Table 'user' has $USER_COUNT rows. Copying parent app db to review app db." | ||
|
||
/app/bin/pg_dump --clean --if-exists --format c --dbname "${PARENT_APP_DATABASE_URL}" --no-owner --no-privileges --no-comments --exclude-schema 'information_schema' --exclude-schema '^pg_*' | /app/bin/pg_restore --clean --if-exists --no-owner --no-privileges --no-comments --dbname "${SCALINGO_POSTGRESQL_URL}" | ||
|
||
fi | ||
|
||
else | ||
echo "Not a review app - skipping database copy" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters