|
| 1 | +# Scalingo |
| 2 | + |
| 3 | +These directives are intended to be used with the [existing NodeJs buildpack](./api/.buildpacks). |
| 4 | + |
| 5 | +## Pre-requisites |
| 6 | + |
| 7 | +You'll need: |
| 8 | + |
| 9 | +- a Scalingo account; |
| 10 | +- a Scalingo CLI. |
| 11 | + |
| 12 | +## Create applications |
| 13 | + |
| 14 | +### API |
| 15 | + |
| 16 | +Create a Scalingo application. |
| 17 | + |
| 18 | +Add a Postgresql and a Redis addon. |
| 19 | + |
| 20 | +Specify the application folder used for deployment: `PROJECT_DIR=api`. |
| 21 | + |
| 22 | +Deploy a first version, which will initialize the database. |
| 23 | + |
| 24 | +### Front-ends |
| 25 | + |
| 26 | +Enable build: `NPM_CONFIG_PRODUCTION=false` |
| 27 | +Specify the application folder used for deployment: `PROJECT_DIR=mon-pix` |
| 28 | +Build production-like asset: `BUILD_ENVIRONMENT=production` |
| 29 | +Setup API proxy: `API_HOST=https://<APPLICATION-NAME>.<REGION>.scalingo.io` |
| 30 | + |
| 31 | +### Check connectivity |
| 32 | + |
| 33 | +Create an account on pix-app. |
| 34 | + |
| 35 | +## Bootstrap |
| 36 | + |
| 37 | +### Get administrator privileges |
| 38 | + |
| 39 | +To be able to create campaigns, you'll need to create an organization. |
| 40 | +These can only be created in pix-admin. |
| 41 | +To get access to pix-admin, grant the relevant privileges to an existing user through SQL: |
| 42 | + |
| 43 | +```shell |
| 44 | +scalingo --region <REGION> --app <APPLICATION-NAME> pgsql-console |
| 45 | +``` |
| 46 | + |
| 47 | +``` postgres-sql |
| 48 | +SELECT u.id FROM users u WHERE u.email = '<EMAIL>'; |
| 49 | +
|
| 50 | +INSERT INTO |
| 51 | +"pix-admin-roles" ("userId", "role") |
| 52 | +VALUES |
| 53 | +(<USER_ID>, 'SUPER_ADMIN'); |
| 54 | +``` |
| 55 | + |
| 56 | +### Plug LCMS preview |
| 57 | + |
| 58 | +Using an admin account previously created on Pix as values, add these environment variables in LCMS : |
| 59 | + |
| 60 | +```dotenv |
| 61 | +# No trailing slash ! |
| 62 | +PIX_API_BASEURL=https://<APPLICATION-NAME>.<REGION>.scalingo.io |
| 63 | +PIX_API_USER_EMAIL=<ACCOUNT-EMAIL> |
| 64 | +PIX_API_USER_PASSWORD=<ACCOUNT-PASSWORD> |
| 65 | +``` |
| 66 | + |
| 67 | +# Github |
| 68 | + |
| 69 | +## Auto-merge |
| 70 | + |
| 71 | +Add in the repository action secrets: |
| 72 | + |
| 73 | +- a secret named `PIX_SERVICE_ACTIONS_TOKEN` |
| 74 | +- containing a valid GitHub token |
| 75 | +- for a user with repository write access in the repository action secrets |
| 76 | + |
| 77 | +## Configuration file change |
| 78 | + |
| 79 | +Add in the repository action secrets: |
| 80 | + |
| 81 | +- a secret named `SLACK_BOT_TOKEN` |
| 82 | +- containing a valid Slack token |
| 83 | + |
| 84 | +Add in the repository action secrets: |
| 85 | + |
| 86 | +- a secret named `INTEGRATION_ENV_URL` |
| 87 | +- containing a link to the scalingo application |
0 commit comments