diff --git a/Makefile b/Makefile index 4b467971..389af50e 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,41 @@ build: clean REACT_APP_ENV=staging \ REACT_APP_CLIENT=instat \ npm run build + +build-a: clean + REACT_APP_TYPE=ott \ + REACT_APP_ENV=staging \ + REACT_APP_CLIENT=instat \ + REACT_APP_STAGE=a-staging \ + npm run build + +build-b: clean + REACT_APP_TYPE=ott \ + REACT_APP_ENV=staging \ + REACT_APP_CLIENT=instat \ + REACT_APP_STAGE=b-staging \ + npm run build + +build-c: clean + REACT_APP_TYPE=ott \ + REACT_APP_ENV=staging \ + REACT_APP_CLIENT=instat \ + REACT_APP_STAGE=c-staging \ + npm run build + +build-d: clean + REACT_APP_TYPE=ott \ + REACT_APP_ENV=staging \ + REACT_APP_CLIENT=instat \ + REACT_APP_STAGE=d-staging \ + npm run build + +build-e: clean + REACT_APP_TYPE=ott \ + REACT_APP_ENV=staging \ + REACT_APP_CLIENT=instat \ + REACT_APP_STAGE=e-staging \ + npm run build auth-build: rm -rf build_auth @@ -81,19 +116,19 @@ deploy-all: prod preprod facr-prod stage: build rsync -zavP --delete-before build/ -e 'ssh -p 666' ott-staging@staging.instat.tv:/usr/local/www/ott-staging/wwwroot/ -a-stage: build +a-stage: build-a rsync -zavP --delete-before build/ -e 'ssh -p 666' ott-staging@staging.instat.tv:/usr/local/www/ott-staging/a-wwwroot/ -b-stage: build +b-stage: build-b rsync -zavP --delete-before build/ -e 'ssh -p 666' ott-staging@staging.instat.tv:/usr/local/www/ott-staging/b-wwwroot/ -c-stage: build +c-stage: build-c rsync -zavP --delete-before build/ -e 'ssh -p 666' ott-staging@staging.instat.tv:/usr/local/www/ott-staging/c-wwwroot/ -d-stage: build +d-stage: build-d rsync -zavP --delete-before build/ -e 'ssh -p 666' ott-staging@staging.instat.tv:/usr/local/www/ott-staging/d-wwwroot/ -e-stage: build +e-stage: build-e rsync -zavP --delete-before build/ -e 'ssh -p 666' ott-staging@staging.instat.tv:/usr/local/www/ott-staging/e-wwwroot/ test: diff --git a/src/config/env.tsx b/src/config/env.tsx index 284b1643..d1dcb03b 100644 --- a/src/config/env.tsx +++ b/src/config/env.tsx @@ -12,4 +12,6 @@ export const ENV = process.env.REACT_APP_ENV || 'staging' export const isProduction = ENV === 'production' || ENV === 'preproduction' +export const stageENV = process.env.REACT_APP_STAGE || 'staging' + export const STRIPE_PUBLIC_KEY = process.env.REACT_APP_STRIPE_PK || 'pk_test_fkEjSoWfJXuCwMgwHRpbOGPt' diff --git a/src/features/AuthStore/helpers.tsx b/src/features/AuthStore/helpers.tsx index 35eeabf8..730edd37 100644 --- a/src/features/AuthStore/helpers.tsx +++ b/src/features/AuthStore/helpers.tsx @@ -4,7 +4,7 @@ import { WebStorageStateStore } from 'oidc-client' import { client } from 'config/clients' import { AUTH_SERVICE } from 'config/routes' import { ClientIds } from 'config/clients/types' -import { ENV } from 'config/env' +import { ENV, stageENV } from 'config/env' import type { Languages } from 'config/languages' @@ -24,7 +24,7 @@ const redirectUrl = () => { return `${window.origin}/redirect` } if (ENV === 'staging') { - return `https://${ENV}.${client.name}.tv/redirect` + return `https://${stageENV}.instat.tv/redirect` } return `https://${client.name}.tv/redirect` } diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index cc9c849a..4fdbd7a9 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -5,6 +5,7 @@ declare namespace NodeJS { export interface ProcessEnv { REACT_APP_CLIENT: 'instat' | 'facr', REACT_APP_ENV: 'production' | 'preproduction' | 'staging', + REACT_APP_STAGE: 'staging' | 'a-staging' | 'b-staging' | 'c-staging' | 'd-staging', REACT_APP_TYPE: 'auth-service' | 'ott', } }