Table of Contents
Background
A common use case that we have is to be able to share front end changes with non-developers. For most changes, this requires that a sandbox be built, but this is unnecessary for static front end development. This document describes a process you can use to share a static front end by publishing it to a dedicated Amazon S3 bucket.
For example, if you make changes to the edX Pattern Library then you can include an S3 URL in your pull request. This means that reviewers will be able to see your changes without having to install and build the pattern library themselves.
Pre-Requisites
Request access to the UX test bucket from DevOps
- Create a support ticket here: https://openedx.atlassian.net/servicedesk/customer/portals
Install the AWS command line tool (awscli)
sudo pip install awscli
Collect the following information that you will need to configure AWS
AWS Access Key ID - DevOps will provide you with this ID
AWS Secret Access Key - DevOps will provide you with the secret key
Default region name - us-east-1
Default output format - json
Configure the command line (see Configuring the AWS command line for more details).
aws configure [Provide each piece of information from above]
If you have trouble, read the AWS command line documentation or consult with DevOps.
Upload to S3
You should now be ready to upload a directory containing your static site to S3.
- Decide upon a unique name for your preview. Use the same naming scheme that you use for Git branches, e.g.
andya/new-design
Sync your changes to s3 with the following command:
aws s3 sync YOUR_DIR s3://ux-test.edx.org/YOUR/PATH
You can now view the HTML at the following URL:
http://ux-test.edx.org/YOUR/PATH
Remove Files
Remove your files from S3 using the
rm
commandaws s3 rm --recursive s3://ux-test.edx.org/YOUR/PATH