- Ruby 2.4.2+
- Middleman 3.4.1
- Clone this repo into a local directory
- Change to your new local directory
- Setup local environment keys.
.envrc
works great! Seehowtos/environment.md
. bundle install && yarn
yarn start
– it's not a javascript package, but it's helpful nevertheless
Individual Commands (see package.json):
- Load content:
bundle exec middleman contentful
- Build the site:
bundle exec middleman build
- Or run a local server:
bundle exec middleman
Most things are tested – both in rspec
. Every page is tested that it renders, has a title, meta tags, etc.
You would need load up Contentful first.
Commands (see package.json):
yarn test
yarn rspec
/yarn rspec:tdd
1. Extensions are not tested
2. The logic in the config file is not tested.
The website automatically deploys to staging and production via Github Actions, so normally you don't need to deploy anything manually.
If you must force a local deploy, ensure your environment is all setup (see Environment Configuration), and run this, where env=production|staging
.. See Github Actions workflow for full details how it does it.
git checkout [branch]
git pull origin [branch]
APP_ENV=[env] bundle exec middleman build
APP_ENV=[env] bundle exec middleman s3_sync
- Github Actions manages all of our testing and deployments. This requires a fair bit of setup. See
howtos/environment.md
.- Deploys whenever pushed to
develop
ormaster
(eg. commit, pull request merge, etc). - Deploys whenever a
deployment
is trigger (eg. an inbound API action from Contentful).
- Deploys whenever pushed to
- Contentful deploys automatically via a Create Deployments API webhook.
- This requires a Personal Access Token from an authorized user to make this request. Sharesight has a machine user to hold this key and it lives as a secret in Contentful.
- Create a PR
- Merge PR into
develop
branch. - Github Actions will deploy it to
staging-www.sharesight.com
. - Once build is complete, may take up to 15 minutes to resolve caches.
- Merge PR into
master
branch. - Github Actions will deploy it to
www.sharesight.com
. - Once build is complete, may take up to 15 minutes to resolve caches.
- Use proper language and country codes – there's a reason why UK is GB. https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
- Open
data/locales.json
and copy one of the existing locales. The first locale is the default: global Ensure to maintain capitalization – theid
field should be lowercased. - Ensure the Helpsite and Marketing site have the same locales! Else you will link to a non-existent locale.
Do note, the default_locale_id is set in config.rb.
This is now done in https://github.com/sharesight/static-cloudfront, see lambda-viewer-request/redirects/…