raml2html build script

This commit is contained in:
Devin Howard 2016-10-04 14:02:07 +08:00
parent 3d7a2ef5b1
commit 2466a0912f
5 changed files with 17 additions and 3 deletions

1
.gitignore vendored
View file

@ -7,6 +7,7 @@
#assety stuff
public/assets
public/metamaps_mobile
public/api/index.html
vendor/
node_modules
npm-debug.log

5
bin/build-apidocs.sh Executable file
View file

@ -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

View file

@ -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

View file

@ -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 .

View file

@ -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"
}
}