cd ~/ps/inst/angular npm run buildRun the application after rebuilding
cd ~/ps ./x.sh
cd ~/psSee what we have
git status
git add
the changes I've made in the source code (this is some of the stuff in "Changes not staged for commit").
Here is an example of what might
need to be done. Don't just copy and paste.
git add <whatever I've been working on> git statusCommit my changes
git commit -m "explanation of what was done" git statusRecompile the compiled js
cd ~/ps/inst/angular/ npm run buildUpdate local git repo. See PSNoteRegardingGit
sudo apt install ansibleClone or update the PS ansible repo (if not already present)
cd ~ git clone https://gitlab.app.vumc.org/stephej1/ps-ansible.git/Run the ansible playbook to deploy to PS server virtual machine. Ansible updates the working copy on the server, recompiles, and restarts the app.
cd ~/ps-ansible ansible-playbook playbook.yml
0,30 * * * * systemctl restart ps
cd ~ git clone https://github.com/vubiostat/ps.gitChange to the ps directory
cd ps git branchThe ~/ps/inst/angular/src/environments/environment.demo.ts file should look like this. The IP address is for the local computer where the work is being done.
export const environment: any = { production: false, apiUrl: "http://10.151.20.86:7788" };Make the environment file using the lines above.
touch ~/ps/inst/angular/src/environments/environment.demo.ts vim ~/ps/inst/angular/src/environments/environment.demo.tsThe ~/ps/inst/angular/package.json file should look like this:
"name": "ps", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "node build.js", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^7.2.14", "@angular/common": "^7.2.14", "@angular/compiler": "^7.2.14", "@angular/core": "^7.2.14", "@angular/forms": "^7.2.14", "@angular/http": "^7.2.14", "@angular/platform-browser": "^7.2.14", "@angular/platform-browser-dynamic": "^7.2.14", "@angular/router": "^7.2.14", "@ng-bootstrap/ng-bootstrap": "^4.2.2", "core-js": "^2.6.5", "d3": "^4.9.1", "rxjs": "^6.5.1", "stable": "^0.1.6", "tslib": "^1.9.3", "zone.js": "^0.8.29" }, "devDependencies": { "@angular-devkit/build-angular": "^0.13.8", "@angular/cli": "7.3.8", "@angular/compiler-cli": "^7.2.14", "@angular/language-service": "^7.2.14", "@types/jasmine": "^2.8.16", "@types/jasminewd2": "^2.0.6", "@types/node": "~8.9.4", "codelyzer": "~4.2.1", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~1.7.1", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "^1.4.3", "karma-jasmine": "~1.1.1", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "^5.3.2", "ts-node": "~5.0.1", "tslint": "~5.9.1", "typescript": "~3.2.4" } }Create the~/ps/inst/angular/package.json file.
touch ~/ps/inst/angular/package.json vim ~/ps/inst/angular/package.jsonInstall all the angular bits
cd ~/ps/inst/angular/ npm installBuild angular
npm run buildMake a file of R script that will be needed to run the R backend.
touch ~/ps/run-backend-demo.RContents of ~/ps/run-backend-demo.R
library(devtools) load_all(".") runPS("backend", "10.151.20.86")Make a bash file to launch the app on this workstation.
cd ~/ps touch x.shContents of ~/ps/x.sh
#!/bin/bash SESSION=ps env="$1" dir=`pwd` tmux -2 new-session -d -s $SESSION -c "$dir/inst/angular" -n 'ed' tmux new-window -t $SESSION:1 -n 'sh' -c "$dir/inst/angular" tmux new-window -t $SESSION:2 -n 'ng' -c "$dir/inst/angular" tmux send-keys "npm start -- -c demo" C-m tmux new-window -t $SESSION:3 -n 'ng' -c "$dir/inst/angular" tmux send-keys "CHROME_BIN=/usr/bin/chromium ng test --watch --source-map=false" tmux new-window -t $SESSION:4 -c "$dir" -n 'R' tmux send-keys "R --no-save < run-backend-demo.R" C-m tmux -2 attach-session -t $SESSIONLaunch the app on the local machine. It will be accessible at http://10.151.20.86:4200/ps or http://localhost:4200/ps.
cd ~/ps chmod -x x.sh ./x.sh
cd ~/psLaunch the app on the local machine. It will be accessible at http://10.151.20.86:4200/ps or http://localhost:4200/ps
cd ~/ps ./x.shGit commands...
git status #Check current repository status git branch #See what branches are here git stash git checkout master #Make master branch current git pull #Sync local copy with repository git push # Push local changes to repository git log
npm run build cd ~/ps/inst/appStage the files that have been changed
cd ~/ps git status git add -uAlso stage an untracked file
inst/angular/dist/ps/main.???.jsCommit staged content
cd ~/ps git status git commit -m "explain the changes"Transmit the local commits to the github repository
git push
ssh ps@statcomp2.emp.vumc.ioGo to the PS directory
cd ~/psSync the code with the repository
git pull origin masterFind the currently running backend process (only if R code has been changed)
ps uxKill the currently running backend process (only if R code has been changed)
kill ????Start a new backend process (only if R code has been changed)
./run.sh & #Check https://statcomp2.app.vumc.org/ps/ to be sure the changes are in the current app. Look at the build version and date. Might have to refresh.
Pegasus form | Ticket submitted | Ticket completed | Pegasus id | Notes |
---|---|---|---|---|
VUMC IP address request | 20200608 | 20200609 | R00641450 | still need to update /etc/network/interfaces on VM |
Create a new CI | 20200608 | 20200608 | CI biostatPS created within Pegasus but no ticket number generated | |
VUMC IT Linux-F5 LTM new VIP request | 20200609 | 20200618 | R00641452 | External name: vbiostat.app.vumc.org (160.129.29.83) Internal name: biostat1553-ps.emp.vumc.io (10.151.20.240) |
SMITH, ROB about 2 hours ago Fulfilled with Notes: 'Please configure the IP settings of the device to use the following: IP address = 10.151.20.240 subnet mask = 255.255.255.0 gateway = 10.151.20.1 DC1 DNS server = 10.108.51.18 DC2 DNS server = 10.150.51.18 DC3 DNS server = 10.101.62.234'