fix(#169): autoscalling auth

keep-around/9d11a525a1ee745f785976389c40d7a0601133e1
Rakov Roman 3 years ago
parent d800c5ef9a
commit 9d11a525a1
  1. 40
      .drone.yml
  2. 7
      Makefile
  3. 2
      src/config/routes.tsx
  4. 4
      src/features/AuthServiceApp/components/Oauth/index.tsx
  5. 14
      src/features/AuthServiceApp/config/routes.tsx
  6. 4
      src/features/AuthStore/helpers.tsx
  7. 2
      src/react-app-env.d.ts

@ -454,6 +454,46 @@ 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

@ -85,6 +85,13 @@ 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

@ -13,7 +13,7 @@ export const APIS = {
},
staging: {
api: 'https://api.test.insports.tv',
auth: 'https://auth.test.insports.tv',
auth: 'https://www.auth.test.insports.tv',
},
}

@ -10,7 +10,7 @@ import type { Settings } from 'features/AuthStore/helpers'
import { getClientSettings } from 'features/AuthStore/helpers'
import { T9n } from 'features/T9n'
import { API_ROOT } from '../../config/routes'
import { getApiUrl } from 'features/AuthServiceApp/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 = `${API_ROOT}/oauth`
const url = getApiUrl('/oauth')
const Oauth = () => {
const {

@ -1,12 +1,16 @@
import { ENV } from 'config/env'
import { ENV, isProduction } from 'config/env'
import { readSelectedApi } from 'helpers/selectedApi'
const APIS = {
preproduction: 'https://auth.insports.tv',
production: 'https://auth.insports.tv',
staging: 'https://auth.test.insports.tv',
preproduction: 'https://api.auth.insports.tv',
production: 'https://api.auth.insports.tv',
staging: 'https://api.auth.test.insports.tv',
}
export const API_ROOT = APIS[ENV]
const env = isProduction ? ENV : readSelectedApi() ?? ENV
export const API_ROOT = APIS[env]
export const getApiUrl = (path: string) => (
`${API_ROOT}${path}${window.location.search}`

@ -6,6 +6,8 @@ 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,
@ -48,7 +50,7 @@ export const getClientSettings = (): Settings => ({
client_id: client.auth.clientId,
filterProtocolClaims: false,
loadUserInfo: false,
metadataUrl: `${AUTH_SERVICE}/.well-known/openid-configuration${client.auth.metaDataUrlParams || ''}`,
metadataUrl: `${API_ROOT}/.well-known/openid-configuration${client.auth.metaDataUrlParams || ''}`,
redirect_uri: redirectUrl(),
response_mode: 'query',
response_type: 'id_token token',

@ -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',
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_TYPE: 'auth-service' | 'ott',
}
}

Loading…
Cancel
Save