Pushing to the website's source repo will send a webhook to this server hosted on Heroku, which will build the site and deploy it to either the staging (fi-website-staging) or the production (functionalimperative.com) bucket on Amazon S3.
bundle installheroku logingit remote add heroku https://git.heroku.com/fi-website-autobuild.gitgit push heroku master
- S3 bucket: Open
/s3_config_staging/s3_website.ymlfor staging,/s3_config_production/s3_website.ymlfor production, or/s3_config_demo/s3_website.ymlfor the demo site. Set thes3_bucketfield - AWS access keys: Open the app from the Heroku Dashboard. Click on Settings. In the Config Variables section, set the fields:
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY
-
Important: the Gemfile of this repo must contain all the gems in the website source repo's Gemfile.
- If you update the source repo's Gemfile on
stagingormaster, apply the same changes to the Gemfile of this repo, and push to Heroku here before you push the source repo changes. - This is because you can't run
bundle installfrom an app inside a Heroku dyno. When yougit push herokulocally, Heroku installs the gems available to the dyno based on the Gemfile in this repo
- If you update the source repo's Gemfile on
-
Auto-build jobs are queued by Resque, set to poll the queue every second.
The reason for queuing: /POST request sent by the GitHub webhook to the Heroku server often times out, as Heroku has a fixed 30-second limit for request timeout, and it takes a while to download + build + deploy. Without queuing, most requests return errors to the GitHub webhook.
-
pom.xml is required to add the Java buildpack on Heroku. Java is required by the s3_website gem