Skip to content

Commit

Permalink
task/WG-155: Add dev server as option for backend (#149)
Browse files Browse the repository at this point in the history
* Add dev server as option for backend

* Add client for dev site and locahost

* Improve makefile and tag latest

* Fix linting

* Fix linting issue
  • Loading branch information
nathanfranklin authored Sep 29, 2023
1 parent 382f9af commit aeb1835
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
22 changes: 21 additions & 1 deletion angular/src/app/services/env.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions angular/src/environments/environmentType.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export enum EnvironmentType {
Production = 'production',
Staging = 'staging',
Dev = 'dev' /* i.e. dev.geoapi-services.tacc.utexas.edu*/,
Local = 'local',
}

0 comments on commit aeb1835

Please sign in to comment.