The marketing site shown at www.sharetribe.com
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.
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.
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
:
- Navigate
Administration & Security
->Identity & Access Management
->Users
- Click your own username
- Create a new
Access Key
underSecurity Credentials
- (While you are at it, enable MFA device for extra security)
tl;dr: Run grunt deploy-staging
Test before deploy:
-
Run
grunt build-staging test
. This will build the site into thedist
folder and serve it on port 8889. To only serve whatever is in thedist
folder without building, you can rungrunt test
. -
Test the site at http://localhost:8889.
Deploy:
-
Run
grunt deploy-staging
. -
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.
-
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 andCopy
it. Images and CSS files don't need to be invalidated because checksums are added to their filenames. -
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.
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 of the static site is done with AWS. Follow the AWS setup guide to set up the hosting environment.