Merge pull request #17 from twentyhq/charles-bochet-env-variables-2

Add environment variable to build:latest too
This commit is contained in:
Charles Bochet 2023-01-28 18:36:32 +01:00 committed by GitHub
commit 180e6b17ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -89,6 +89,12 @@ workflows:
region: $AWS_REGION
repo: $AWS_ECR_REPO
tag: latest
extra-build-args: >
--build-arg REACT_APP_AUTH0_DOMAIN=$REACT_APP_AUTH0_DOMAIN
--build-arg REACT_APP_AUTH0_CLIENT_ID=$REACT_APP_AUTH0_CLIENT_ID
--build-arg REACT_APP_AUTH0_CALLBACK_URL=$REACT_APP_AUTH0_CALLBACK_URL
--build-arg REACT_APP_AUTH0_AUDIENCE=$REACT_APP_AUTH0_AUDIENCE
--build-arg REACT_APP_API_URL=$REACT_APP_API_URL
build-and-deploy-api:
when: << pipeline.parameters.build-api >>
@ -133,3 +139,5 @@ workflows:
region: $AWS_REGION
repo: $AWS_ECR_REPO_API
tag: latest
extra-build-args: >
--build-arg HASURA_GRAPHQL_JWT_SECRET=$HASURA_GRAPHQL_JWT_SECRET

View File

@ -37,7 +37,11 @@ root.render(
domain={process.env.REACT_APP_AUTH0_DOMAIN || ''}
clientId={process.env.REACT_APP_AUTH0_CLIENT_ID || ''}
authorizationParams={{
redirect_uri: process.env.REACT_APP_AUTH0_CALLBACK_URL || '',
redirect_uri:
window.location.protocol +
'//' +
window.location.host +
process.env.REACT_APP_AUTH0_CALLBACK_URL || '',
audience: process.env.REACT_APP_AUTH0_AUDIENCE || '',
}}
>

View File

@ -3,6 +3,6 @@ HASURA_GRAPHQL_ADMIN_SECRET=hasura_secret
REACT_APP_AUTH0_DOMAIN=twenty-dev.eu.auth0.com
REACT_APP_AUTH0_CLIENT_ID=REPLACE_ME
REACT_APP_AUTH0_CALLBACK_URL=http://localhost:3001/auth/callback
REACT_APP_AUTH0_CALLBACK_URL=/auth/callback
REACT_APP_AUTH0_AUDIENCE=hasura-dev
REACT_APP_API_URL=http://localhost:8080/v1/graphql