Skip to content

Commit

Permalink
feat(#384): Update npm script to allow start/stop of all container se…
Browse files Browse the repository at this point in the history
…rvices
  • Loading branch information
tholulomo committed May 11, 2023
1 parent 3a2cbc4 commit 3910faf
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Windows OS:
# :warning: ADVISORY :warning:
> Before running the steps below, follow the steps [here](https://github.com/Duke-MatSci/materialsmine/blob/develop/resfulservice/misc/README.md) to retrieve and deploy required environment variables
> Install nvm [windows](https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows#install-nvm-windows-nodejs-and-npm), for mac `brew install nvm`
## :high_brightness: Testing
To avoid testing failure, install nvm & copy the command below and run in the project root directory.

Expand Down
2 changes: 1 addition & 1 deletion app/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.18.1
16.20.0
16 changes: 16 additions & 0 deletions install
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

export NVM_DIR=$HOME/.nvm;
source $NVM_DIR/nvm.sh;

args=$1
if [ "$args" == "install" ] ; then
yes | npm i && cd app && nvm use && npm i && cd ../resfulservice && nvm use && npm i && cd .. && docker-compose build
echo "Completed '$args' successfully!"
exit
elif [ "$args" == "re-install" ] ; then
yes | rm -rf node_modules && npm i && cd app && rm -rf node_modules && nvm use && npm i && cd ../resfulservice && rm -rf node_modules && nvm use && npm i && cd .. && docker system prune -a && docker-compose build
echo "Completed '$args' successfully!"
exit
fi
echo 'Did not understand args', "$args"
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
"prepare": "husky install",
"lint:frontend": "(cd app && npm run lint:test)",
"lint:server": "(cd resfulservice && npm run lint:test)",
"test": "npm-run-all -s lint:frontend lint:server"
"test": "npm-run-all -s lint:frontend lint:server",
"dev:install": "./install install",
"dev:re-install": "./install re-install",
"dev:start": "docker-compose up",
"dev:stop": "docker-compose down -v"
}
}
2 changes: 1 addition & 1 deletion resfulservice/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.18.1
16.20.0

0 comments on commit 3910faf

Please sign in to comment.