- 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:
middleman contentful
- Build the site:
middleman build
- Or run a local server:
middleman
Most things are tested – both in rspec
and jest
. Every page is tested that it renders, has a title, meta tags, etc.
You need to install packages and run yarn contentful
first.
Commands (see package.json):
yarn test
yarn rspec
/yarn rspec:tdd
yarn jest
/yarn jest:tdd
1. Extensions are not tested
2. The logic in the config file is not tested.
- See
lambda/README.md
!
The website automatically deploys to staging and production from the Travis-CI build, so normally you don't need to deploy anything manually.
- Create PR
- Merge PR into
develop
branch. - Travis will deploy it to
staging-www.sharesight.com
. - Once build is complete, may take up to 15 minutes to resolve caches.
Note: When Travis-CI builds the develop
branch, it will automatically deploy
the code to staging-www.sharesight.com
after any successful build. The
instructions below are just for those cases when you want to manually deploy.
Make sure you've modified your configuration settings (as described below) before proceeding with deploying to staging or production.
git checkout develop
git pull origin develop
APP_ENV=staging bundle exec middleman build
APP_ENV=staging bundle exec middleman s3_sync
- Merge PR into
master
branch. - Travis will deploy it to
www.sharesight.com
. - Once build is complete, may take up to 15 minutes to resolve caches.
Note: When Travis-CI builds the master
branch, it will automatically deploy
the code to www.sharesight.com
after any successful build. The
instructions below are just for those cases when you want to manually deploy.
Make sure you've modified your configuration settings (as described below) before proceeding with deploying to staging or production.
git checkout master
git pull origin master
APP_ENV=production bundle exec middleman build
APP_ENV=production bundle exec middleman s3_sync
- 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. - Create the file
plans/[country_id].json
. Every plan defaults fromplans/[default_locale_id].json
(via merge), so only overrides need to be in the country plans file. - 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.
-
Change the XML source file
s3/www.sharesight.com_redirection_rules.xml
s3/staging-www.sharesight.com_redirection_rules.xml
-
Commit and push your changes
-
Copy the content of the file to the production bucket properties or staging bucket properties on AWS
using `Properties`, then `Static Website Hosting`, and finally paste
them into the textarea
![bucket properties](s3/bucket_properties.png)
and press the `Save` button.