City of Philadelphia Mayor's Office of Sustainability Greenworks Report
To set up a dev environment on your local machine, run the following:
# Ruby gems for css compilation gem install sass compass # Ruby gem for deployment # Requires java jre to be installed on your system gem install s3_website # Global npm packages for dev npm install -g grunt-cli bower # Install project dependencies npm install bower install
Note: These commands assume you have ruby and node installed locally. If using your host machine's default distributions, you'll need to prefix the first two commands with sudo.
We highly recommend setting up local installations using RVM and NVM for ruby and node respectively so you don't need admin rights.
Once the above dependencies are installed, run the dev grunt server with:
The app will be served at http://localhost:9000
Ensure when updating that the try catch check in the vis-service.js get() function is still valid for the newer version of cartodb.js.
TODO: Add a js test for this condition
Install the dependencies as listed above, then:
First, ensure bower components are up to date:
Then, build the minified app with:
Configure s3_website for deployment by setting the following ENV variables:
Once the AWS access keys are set in your environment, deploy the app:
s3_website push --force
If you want to change the bucket the app deploys to, edit the
s3_bucket setting in s3_website.yml
If you change the bucket, ensure you setup static hosting and bucket permissions via the AWS console.