From aeb1835d70e871beade463e6062fbe097b4ccd70 Mon Sep 17 00:00:00 2001 From: Nathan Franklin Date: Fri, 29 Sep 2023 14:44:50 -0500 Subject: [PATCH] task/WG-155: Add dev server as option for backend (#149) * Add dev server as option for backend * Add client for dev site and locahost * Improve makefile and tag latest * Fix linting * Fix linting issue --- Makefile | 5 +++-- angular/src/app/services/env.service.ts | 22 ++++++++++++++++++++- angular/src/environments/environmentType.ts | 1 + 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 04ca576e..3ec5b55f 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ TAG := $(shell git log --format=%h -1) IMAGE ?= taccaci/hazmapper:$(TAG) -.PHONY: image -image: +.PHONY: build +build: docker build -t $(IMAGE) -f angular/Dockerfile . + docker tag taccaci/hazmapper:${TAG} taccaci/hazmapper:latest .PHONY: deploy deploy: diff --git a/angular/src/app/services/env.service.ts b/angular/src/app/services/env.service.ts index 7a52cc2b..347938ff 100644 --- a/angular/src/app/services/env.service.ts +++ b/angular/src/app/services/env.service.ts @@ -20,6 +20,8 @@ export class EnvService { return 'https://agave.designsafe-ci.org/geo-staging/v2'; } else if (backend === EnvironmentType.Production) { return 'https://agave.designsafe-ci.org/geo/v2'; + } else if (backend === EnvironmentType.Dev) { + return 'https://agave.designsafe-ci.org/geo-dev/v2'; } else { throw new Error('Unsupported Type'); } @@ -131,7 +133,7 @@ export class EnvService { // local devevelopers can use localhost or hazmapper.local but // hazmapper.local is preferred as TAPIS supports it as a frame ancestor // (i.e. it allows for point cloud iframe preview) - this._clientId = /^localhost/.test(hostname) ? 'RMCJHgW9CwJ6mKjhLTDnUYBo9Hka' : 'Eb9NCCtWkZ83c01UbIAITFvhD9ka'; + this._clientId = /^localhost/.test(hostname) ? 'XgCBlhfAaqfv7jTu3NRc4IJDGdwa' : 'Eb9NCCtWkZ83c01UbIAITFvhD9ka'; } else if (/^hazmapper.tacc.utexas.edu/.test(hostname) && pathname.startsWith('/staging')) { this._env = EnvironmentType.Staging; this._apiUrl = this.getApiUrl(this.env); @@ -150,6 +152,24 @@ export class EnvService { clientToken: 'MLY|4936281379826603|f8c4732d3c9d96582b86158feb1c1a7a', }, }; + } else if (/^hazmapper.tacc.utexas.edu/.test(hostname) && pathname.startsWith('/dev')) { + this._env = EnvironmentType.Staging; + this._apiUrl = this.getApiUrl(this.env); + this._taggitUrl = origin + '/taggit-dev'; /* doesn't yet exist */ + this._portalUrl = this.getPortalUrl(this.env); + this._clientId = 'oEuGsl7xi015wnrEpxIeUmvzc6Qa'; + this._baseHref = '/dev/'; + this._streetviewEnv.secrets = { + google: { + clientSecret: '', + clientId: '573001329633-1p0k8rko13s6n2p2cugp3timji3ip9f0.apps.googleusercontent.com', + }, + mapillary: { + clientSecret: 'MLY|4936281379826603|cafd014ccd8cfc983e47c69c16082c7b', + clientId: '4936281379826603', + clientToken: 'MLY|4936281379826603|f8c4732d3c9d96582b86158feb1c1a7a', + }, + }; } else if (/^hazmapper.tacc.utexas.edu/.test(hostname)) { this._env = EnvironmentType.Production; this._apiUrl = this.getApiUrl(this.env); diff --git a/angular/src/environments/environmentType.ts b/angular/src/environments/environmentType.ts index 8966af10..12a46949 100644 --- a/angular/src/environments/environmentType.ts +++ b/angular/src/environments/environmentType.ts @@ -1,5 +1,6 @@ export enum EnvironmentType { Production = 'production', Staging = 'staging', + Dev = 'dev' /* i.e. dev.geoapi-services.tacc.utexas.edu*/, Local = 'local', }