lair-framework/lair

Update Wiki

relyt29 opened this issue · 1 comments

Hi,

The wiki doesn't have public edit rights, so I can't just add content - I created this issue so you can see the content I want to add and if you want you can add it yourself to the wiki, if not, then feel free to close this issue and ignore it:

I wrote a simple one-off script to help manage launching and closing the lair framework once it's been installed following the installation instructions in the wiki. Copy the below into a file like "startlair.sh" and execute it, it'll launch all the necessary components. Hitting any key while the script is running should kill all the necessary processes and shut down all the components.

export ROOT_URL=http://localhost
export PORT=11014
export MONGO_URL=mongodb://localhost:27017/lair
export MONGO_OPLOG_URL=mongodb://localhost:27017/local
export API_LISTENER=localhost:11015
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

./mongodb-linux-x86_64-3.2.1/bin/mongod --dbpath=db --bind_ip=localhost --quiet --nounixsocket --replSet rs0 &
MONGOPROCESS=$!
sleep 3
cd bundle; nvm use v0.10.41; node main.js &
cd ../; ./api-server_linux_amd64 &
APIPROCESS=$(ps aux | grep "\.\/api-server_linux_amd64" | grep -v "grep" | tr -s ' ' | cut -f 2 -d ' ')
sleep 2
./caddy --conf=Caddyfile &
CADDYPROCESS=$!

trap "{ kill $MONGOPROCESS ; kill $CADDYPROCESS ; kill $APIPROCESS ; exit 1 }" SIGINT SIGTERM EXIT

read towait

Sweet deal, added! Thanks :)