install:
	npm install

develop:
	REACT_APP_TYPE=ott \
	REACT_APP_CLIENT=insports \
	npm start

clean:
	rm -rf build

build: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=staging \
	REACT_APP_CLIENT=insports \
	npm run build

build-stage: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=preproduction \
	REACT_APP_CLIENT=insports \
	REACT_APP_STRIPE_PK=pk_live_51J5TEYEDSxVnTgDW5XxhC6ntKZKddXgKHq5HOCDmJTdfSKluMYCdLHOcUA3Miuy8HesxG1eS4c0dQRQpMsEHRrQL00USpu5xIq \
	npm run build

build-a: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=staging \
	REACT_APP_CLIENT=insports \
	REACT_APP_STAGE=test-a \
	npm run build

build-b: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=staging \
	REACT_APP_CLIENT=insports \
	REACT_APP_STAGE=test-b \
	npm run build

build-c: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=staging \
	REACT_APP_CLIENT=insports \
	REACT_APP_STAGE=test-c \
	npm run build

build-d: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=staging \
	REACT_APP_CLIENT=insports \
	REACT_APP_STAGE=test-d \
	npm run build

build-e: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=staging \
	REACT_APP_CLIENT=insports \
	REACT_APP_STAGE=test-e \
	npm run build

build-f: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=staging \
	REACT_APP_CLIENT=insports \
	REACT_APP_STAGE=test-f \
	npm run build

build-g: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=staging \
	REACT_APP_CLIENT=insports \
	REACT_APP_STAGE=test-g \
	npm run build

build-h: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=staging \
	REACT_APP_CLIENT=insports \
	REACT_APP_STAGE=test-h \
	npm run build

build-i: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=staging \
	REACT_APP_CLIENT=insports \
	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

	REACT_APP_TYPE=auth-service \
	REACT_APP_ENV=staging \
	REACT_APP_GOOGLE_CLIENT_ID=1022673777479-43mqb9lsqkpcr47umuvsoo0eemfpljf5.apps.googleusercontent.com \
	REACT_APP_FACEBOOK_CLIENT_ID=798254931203361 \
	BUILD_PATH=build_auth \
	GENERATE_SOURCEMAP=false \
	npx react-scripts build

	npx gzipper --verbose build_auth

auth-production-build:
	rm -rf build_auth

	REACT_APP_TYPE=auth-service \
	REACT_APP_ENV=production \
	REACT_APP_GOOGLE_CLIENT_ID=1022673777479-43mqb9lsqkpcr47umuvsoo0eemfpljf5.apps.googleusercontent.com \
	REACT_APP_FACEBOOK_CLIENT_ID=798254931203361 \
	BUILD_PATH=build_auth \
	GENERATE_SOURCEMAP=false \
	npx react-scripts build

	npx gzipper --verbose build_auth

facr-build: clean
	REACT_APP_TYPE=ott \
    REACT_APP_ENV=staging \
    REACT_APP_CLIENT=facr \
    npm run build

india-build: clean
	REACT_APP_TYPE=ott \
    REACT_APP_ENV=staging \
    REACT_APP_CLIENT=india \
    npm run build

lff-build: clean
	REACT_APP_TYPE=ott \
    REACT_APP_ENV=staging \
	REACT_APP_CLIENT=lff \
    npm run build

.PHONY: build

prod: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=production \
	REACT_APP_CLIENT=insports \
	REACT_APP_STRIPE_PK=pk_live_51J5TEYEDSxVnTgDW5XxhC6ntKZKddXgKHq5HOCDmJTdfSKluMYCdLHOcUA3Miuy8HesxG1eS4c0dQRQpMsEHRrQL00USpu5xIq \
	npm run build && cp -r .well-known build

preprod: clean
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=preproduction \
	REACT_APP_STAGE=test \
	REACT_APP_CLIENT=insports \
	REACT_APP_STRIPE_PK=pk_live_51J5TEYEDSxVnTgDW5XxhC6ntKZKddXgKHq5HOCDmJTdfSKluMYCdLHOcUA3Miuy8HesxG1eS4c0dQRQpMsEHRrQL00USpu5xIq \
	npm run build

india-prod:
	rm -rf build_india && \
    REACT_APP_TYPE=ott \
    REACT_APP_ENV=production \
    REACT_APP_CLIENT=india \
    REACT_APP_STRIPE_PK=pk_live_51J5TEYEDSxVnTgDW5XxhC6ntKZKddXgKHq5HOCDmJTdfSKluMYCdLHOcUA3Miuy8HesxG1eS4c0dQRQpMsEHRrQL00USpu5xIq \
    BUILD_PATH=build_india \
    npm run build && cp -r .well-known build_india

facr-prod:
	rm -rf build_facr && \
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=production \
	REACT_APP_STRIPE_PK=pk_live_51J5TEYEDSxVnTgDW5XxhC6ntKZKddXgKHq5HOCDmJTdfSKluMYCdLHOcUA3Miuy8HesxG1eS4c0dQRQpMsEHRrQL00USpu5xIq \
	REACT_APP_CLIENT=facr \
	BUILD_PATH=build_facr \
	npm run build && cp -r .well-known build_facr

lff-prod:
	rm -rf build_lff && \
	REACT_APP_TYPE=ott \
	REACT_APP_ENV=production \
	REACT_APP_STRIPE_PK=pk_live_51J5TEYEDSxVnTgDW5XxhC6ntKZKddXgKHq5HOCDmJTdfSKluMYCdLHOcUA3Miuy8HesxG1eS4c0dQRQpMsEHRrQL00USpu5xIq \
	REACT_APP_CLIENT=lff \
	BUILD_PATH=build_lff \
	npm run build && cp -r .well-known build_lff

deploy-all: prod preprod facr-prod lff-prod

test:
	npm test

.PHONY: test
