diff --git a/.gitignore b/.gitignore index 7f17330b..df92a1b7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ #assety stuff public/assets public/metamaps_mobile +public/api/index.html vendor/ node_modules npm-debug.log diff --git a/bin/build-apidocs.sh b/bin/build-apidocs.sh new file mode 100755 index 00000000..677bbffd --- /dev/null +++ b/bin/build-apidocs.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# Note: you need to run `npm install` before using this script or raml2html won't be installed + +./node_modules/.bin/raml2html -i ./doc/api/api.raml -o ./public/api/index.html diff --git a/doc/production/first-deploy.md b/doc/production/first-deploy.md index cc3a1f4a..b118a2b5 100644 --- a/doc/production/first-deploy.md +++ b/doc/production/first-deploy.md @@ -65,7 +65,14 @@ Run this in the metamaps directory, still as metamaps: sudo aptitude install nodejs npm sudo ln -s /usr/bin/nodejs /usr/bin/node npm install - npm run build + +#### Precompile assets + +This step depends on running npm install first; assets:precompile will run `NODE_ENV=production npm run build`, and the build-apidocs.sh script requires the raml2html npm package. + + rake assets:precompile + rake perms:fix + bin/build-apidocs.sh #### Nginx and SSL diff --git a/doc/production/pull-changes.md b/doc/production/pull-changes.md index 30f41cf5..1bd1ebbe 100644 --- a/doc/production/pull-changes.md +++ b/doc/production/pull-changes.md @@ -26,6 +26,7 @@ Now that you have the code, run these commands: npm install rake db:migrate rake assets:precompile # includes `npm run build` + bin/build-apidocs.sh rake perms:fix passenger-config restart-app . diff --git a/package.json b/package.json index 12f42e6c..751ef284 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "lodash": "4.16.1", "node-uuid": "1.4.7", "outdent": "0.2.1", + "raml2html": "^4.0.0-beta5", "react": "15.3.2", "react-dom": "15.3.2", "socket.io": "0.9.12", @@ -41,7 +42,6 @@ "chai": "^3.5.0", "eslint": "^3.5.0", "eslint-plugin-react": "^6.3.0", - "mocha": "^3.0.2", - "raml2html": "^4.0.0-beta5" + "mocha": "^3.0.2" } }