diff --git a/.drone.yml b/.drone.yml index 6397fe22..c9f8dd62 100644 --- a/.drone.yml +++ b/.drone.yml @@ -454,46 +454,6 @@ steps: - aws cloudfront create-invalidation --distribution-id EJYRP4WNVMWD1 --paths "/*" ---- -kind: pipeline -type: docker -name: deploy test-j - -concurrency: - limit: 1 - -platform: - os: linux - arch: amd64 - -trigger: - ref: - - refs/heads/test-j - -steps: - - name: deploy script - image: node:16-alpine - - environment: - AWS_ACCESS_KEY_ID: - from_secret: AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY: - from_secret: AWS_SECRET_ACCESS_KEY - AWS_DEFAULT_REGION: - from_secret: AWS_DEFAULT_REGION - REACT_APP_STRIPE_PK: - from_secret: REACT_APP_STRIPE_PK_TEST - SSH_KEY_AUTH: - from_secret: SSH_KEY_AUTH - - commands: - - apk add --no-cache aws-cli bash git openssh-client make rsync - - npm install --legacy-peer-deps - - make build-j - - aws s3 sync build s3://instat-frontend-test-j --delete - - aws cloudfront create-invalidation --distribution-id EC35D25OP7FSL --paths "/*" - - --- kind: pipeline type: docker diff --git a/Makefile b/Makefile index 293df69c..8345e806 100644 --- a/Makefile +++ b/Makefile @@ -85,13 +85,6 @@ build-i: clean REACT_APP_STAGE=test-i \ npm run build -build-j: clean - REACT_APP_TYPE=ott \ - REACT_APP_ENV=staging \ - REACT_APP_CLIENT=insports \ - REACT_APP_STAGE=test-j \ - npm run build - auth-build: rm -rf build_auth diff --git a/src/config/routes.tsx b/src/config/routes.tsx index 8c769dfa..b307e805 100644 --- a/src/config/routes.tsx +++ b/src/config/routes.tsx @@ -13,7 +13,7 @@ export const APIS = { }, staging: { api: 'https://api.test.insports.tv', - auth: 'https://www.auth.test.insports.tv', + auth: 'https://auth.test.insports.tv', }, } diff --git a/src/features/AuthServiceApp/components/Oauth/index.tsx b/src/features/AuthServiceApp/components/Oauth/index.tsx index d408c8fe..da5feca2 100644 --- a/src/features/AuthServiceApp/components/Oauth/index.tsx +++ b/src/features/AuthServiceApp/components/Oauth/index.tsx @@ -10,7 +10,7 @@ import type { Settings } from 'features/AuthStore/helpers' import { getClientSettings } from 'features/AuthStore/helpers' import { T9n } from 'features/T9n' -import { getApiUrl } from 'features/AuthServiceApp/config/routes' +import { API_ROOT } from '../../config/routes' import { PAGES } from '../../config/pages' import { useOauth } from './hooks' import { @@ -29,7 +29,7 @@ import { } from './styled' import { ErrorPopup } from '../../../../components/ErrorPopup' -const url = getApiUrl('/oauth') +const url = `${API_ROOT}/oauth` const Oauth = () => { const { diff --git a/src/features/AuthServiceApp/config/routes.tsx b/src/features/AuthServiceApp/config/routes.tsx index 30ba0ea8..9aa8df43 100644 --- a/src/features/AuthServiceApp/config/routes.tsx +++ b/src/features/AuthServiceApp/config/routes.tsx @@ -1,16 +1,12 @@ -import { ENV, isProduction } from 'config/env' - -import { readSelectedApi } from 'helpers/selectedApi' +import { ENV } from 'config/env' const APIS = { - preproduction: 'https://api.auth.insports.tv', - production: 'https://api.auth.insports.tv', - staging: 'https://api.auth.test.insports.tv', + preproduction: 'https://auth.insports.tv', + production: 'https://auth.insports.tv', + staging: 'https://auth.test.insports.tv', } -const env = isProduction ? ENV : readSelectedApi() ?? ENV - -export const API_ROOT = APIS[env] +export const API_ROOT = APIS[ENV] export const getApiUrl = (path: string) => ( `${API_ROOT}${path}${window.location.search}` diff --git a/src/features/AuthStore/helpers.tsx b/src/features/AuthStore/helpers.tsx index 7f8662a1..4edfec33 100644 --- a/src/features/AuthStore/helpers.tsx +++ b/src/features/AuthStore/helpers.tsx @@ -6,8 +6,6 @@ import { AUTH_SERVICE } from 'config/routes' import { ClientIds, ClientNames } from 'config/clients/types' import { ENV, stageENV } from 'config/env' -import { API_ROOT } from 'features/AuthServiceApp/config/routes' - export interface Settings extends UserManagerSettings { client_id: ClientIds, lang?: string, @@ -50,7 +48,7 @@ export const getClientSettings = (): Settings => ({ client_id: client.auth.clientId, filterProtocolClaims: false, loadUserInfo: false, - metadataUrl: `${API_ROOT}/.well-known/openid-configuration${client.auth.metaDataUrlParams || ''}`, + metadataUrl: `${AUTH_SERVICE}/.well-known/openid-configuration${client.auth.metaDataUrlParams || ''}`, redirect_uri: redirectUrl(), response_mode: 'query', response_type: 'id_token token', diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index 65952d05..9c206a49 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -5,7 +5,7 @@ declare namespace NodeJS { export interface ProcessEnv { REACT_APP_CLIENT: 'instat' | 'facr' | 'lff' | 'insports', REACT_APP_ENV: 'production' | 'preproduction' | 'staging', - REACT_APP_STAGE: 'staging' | 'test-a' | 'test-b' | 'test-c' | 'test-d' | 'test-e' | 'test-f' | 'test-g' | 'test-h' | 'test-i' | 'test-j' | 'test', + REACT_APP_STAGE: 'staging' | 'test-a' | 'test-b' | 'test-c' | 'test-d' | 'test-e' | 'test-f' | 'test-g' | 'test-h' | 'test-i' | 'test', REACT_APP_TYPE: 'auth-service' | 'ott', } }