Skip to content
Snippets Groups Projects
Commit 165f8f56 authored by Reid Givens's avatar Reid Givens
Browse files

updated deploy script and env.js to try and guess at the right endpoints, so...

updated deploy script and env.js to try and guess at the right endpoints, so this can be deployed to dev, test, or prod
parent 0a777a4d
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,11 @@ To get more help on the Angular CLI use `ng help` or go check out the [Angular C
## Deploy
The service endpoint is set in the `src/env.js`, which is a file that is not collapsed into the rest of the angular build, so it can be changed after deploy if needed.
The service endpoint is set in the `src/env.js`, which is a file that is not collapsed into the rest of the angular build,
so it can be changed after deploy if needed. That file will try and guess the right endpoint based on the `window.location.hostname`.
Deploy to `webtest` by running `./deploy.sh`.
Deploy by running `./deploy.sh {dev|test|prod}`. If no arguments are given, it defaults to dev.
dev = webtest.aoc.nrao.edu <br />
test = archive-test.nrao.edu <br />
prod = archive-new.nrao.edu
#!/bin/bash
DESTINATION=${1:-dev}
case $DESTINATION in
dev)
SERVER=webtest.aoc.nrao.edu
USER=webapps
;;
test)
SERVER=archive-test.nrao.edu
USER=webapps
;;
prod)
SERVER=archive-new.nrao.edu
USER=webapps
;;
*)
echo $"Usage: ${DESTINATION} {dev|test|prod}"
exit 1
;;
esac
ng build --optimization=true --prod=true
ssh-add ~/.ssh/ssa16
ssh root@webtest.aoc.nrao.edu 'rm -R /home/webtest.aoc.nrao.edu/content/vlass-manager/*'
scp -r dist/vlass-manager/* root@webtest.aoc.nrao.edu:/home/webtest.aoc.nrao.edu/content/vlass-manager
ssh $USER@$SERVER "rm -R /home/${SERVER}/content/vlass-manager/*"
scp -r dist/vlass-manager/* $USER@$SERVER:/home/$SERVER/content/vlass-manager
ssh $USER@$SERVER "chmod -R 775 /home/${SERVER}/content/vlass-manager/*"
......@@ -6,14 +6,21 @@ A service in angular will capture this info and add it to a service
(function (window) {
window.__env = window.__env || {};
// API url
// Local service
// window.__env.configUrl = 'http://localhost:4200/VlassMngr/services/configuration';
switch (window.location.hostname) {
case 'archive-test.nrao.edu':
window.__env.configUrl = 'https://archive-test.nrao.edu/VlassMngr/services/configuration';
break;
case 'archive-new.nrao.edu':
window.__env.configUrl = 'https://archive-new.nrao.edu/VlassMngr/services/configuration';
break;
default:
window.__env.configUrl = 'https://webtest.aoc.nrao.edu/VlassMngr/services/configuration';
break;
}
// "new home" on webtest after split
window.__env.configUrl = 'https://webtest.aoc.nrao.edu/VlassMngr/services/configuration';
// old home on webtest
// window.__env.configUrl = 'http://webtest.aoc.nrao.edu:8080/VlassMngr/services/configuration';
/**
* If you need to overwrite this for this server, use the following
*/
// window.__env.configUrl = 'https://webtest.aoc.nrao.edu/VlassMngr/services/configuration';
}(this));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment