/marketing-site

The marketing site shown at www.sharetribe.com

Primary LanguageHTML

The sharetribe.com marketing site

The marketing site shown at www.sharetribe.com

Getting started

Setting up the dev environment

Prerequisites: git, node, npm, gem

git clone git@github.com:sharetribe/marketing-site.git
cd marketing-site
gem install compass
npm install -g grunt-cli
npm install # This will download the whole internet, so be patient

Set up aws-keys.json as described here.

Development

Run

grunt dev

...to start a local server on port 8888. Open http://localhost:8888 to access the site.

This task also watches changes in SCSS files to auto-compile new CSS files. It also refreshes your browser when changes occur.

Deploy

AWS Credentials

If you are only developing locally, you do not need AWS access. Create an empty aws-keys.json file with the following command:

echo '{}' >> aws-keys.json

In order to deploy, the aws-keys.json should have the following content:

  {
    "AWSAccessKeyId": "AKxxxxxxxxxx",
    "AWSSecretKey": "super-secret-key"
  }

You can create your own id and key by navigating to AWS console:

  1. Navigate Administration & Security -> Identity & Access Management -> Users
  2. Click your own username
  3. Create a new Access Key under Security Credentials
  4. (While you are at it, enable MFA device for extra security)

Deploy to staging

tl;dr: Run grunt deploy-staging

Test before deploy:

  1. Run grunt build-staging test. This will build the site into the dist folder and serve it on port 8889. To only serve whatever is in the dist folder without building, you can run grunt test.

  2. Test the site at http://localhost:8889.

Deploy:

  1. Run grunt deploy-staging.

  2. Open the S3 URL (http://www.sharetri.be.s3-website-us-east-1.amazonaws.com/ or http://www.sharetribe.com.s3-website-us-east-1.amazonaws.com/) and test.

  3. Open the CloudFront console, click the staging distribution and select the Invalidations tab. Invalidate all HTML files. The easiest way to do this is to select a previous invalidation task that invalidated all the HTML files and Copy it. Images and CSS files don't need to be invalidated because checksums are added to their filenames.

  4. Make sure the cache is invalidated: open sharetri.be, the staging site, in your browser. Check through the source code. Scroll to the bottom and make sure the VERSION is updated.

Deploy to production

tl;dr: Run grunt deploy-prod

Go over the same steps as with staging but use build-prod instead of build-staging and deploy-prod instead of deploy-staging. Be sure to invalidate the content in the correct CloudFront distribution.

Hosting setup

Hosting of the static site is done with AWS. Follow the AWS setup guide to set up the hosting environment.