diff --git a/.awsbox.json b/.awsbox.json new file mode 100644 index 0000000..8136991 --- /dev/null +++ b/.awsbox.json @@ -0,0 +1,6 @@ +{ + "processes": ["server.js"], + "hooks": { + "postdeploy": "scripts/postdeploy.sh" + } +} diff --git a/README.rst b/README.rst index 841d5ec..3a7ab18 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ loads-web ========= -Web dashboard for Loads, v2. +Web dashboard for Loads, v2. https://github.com/loads/loads-broker * Monitors active loadtests @@ -12,7 +12,6 @@ https://github.com/loads/loads-broker This is a work in progress. FOR DEMO ONLY. - Development =========== @@ -26,4 +25,25 @@ Watch and compile stylus to CSS: Starting the server: - node server \ No newline at end of file + node server + + +Deployment +========== + +The dashboard is hosted by a hapi server that proxies API requests to a +separate broker instance. This allows the front-end to be developed +independently of the broker, and provides a mechanism for serving mock data +if the broker does not implement a particular call. + +You can use `awsbox `_ to deploy the hapi +server to AWS: + +.. code-block:: bash + + # Create the instance. + > AWS_REGION=us-west-2 AWS_ID={id} AWS_SECRET={secret} \ + AWS_EMAIL=me@example.com awsbox create -n loads-web + + # Deploy committed changes. + > git push loads-web HEAD:master diff --git a/package.json b/package.json index c53f657..12dd0cc 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,13 @@ "mysql": "2.5.4", "remarkable": "1.6.0", "sequelize": "2.0.0-rc8", - "stylus": "0.50.0" + "stylus": "0.50.0", + "bower": "1.3.12" }, "devDependencies": { "eslint": "0.13.0", - "nsp": "1.0.0" + "nsp": "1.0.0", + "awsbox": "0.7.0" }, "homepage": "https://github.com/loads/loads-web", "keywords": [ diff --git a/scripts/postdeploy.sh b/scripts/postdeploy.sh new file mode 100755 index 0000000..3cf7f38 --- /dev/null +++ b/scripts/postdeploy.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +npm install stylus +npm run prestart