To create a review app on Artsy.net:
- Push a commit to a branch with with
review-app-
in the name (eg:review-app-hello-world
) - Then visit https://hello-world.artsy.net
Further commits to the branch will update and deploy changes to the review app.
For those that are curious about what's going on behind the scenes, read on!
If you want to create a deploy for a WIP feature or for QA, Hokusai supports Review Apps.
You can create a review app via CircleCI which runs the build_review_app.sh
script. Or, you can run that script locally, which will be slower because it involves building the docker image locally and pushing it up to AWS ECR.
The rest of the doc assumes you are working with a review app called awesome-feature
.
This is the easiest and fastest way. Push up a branch named review-app-awesome-feature
CircleCI will match the review-app-
prefix and either:
- Create a review app using
build_review_app.sh
if the review app doesn't exist yet (i.e. first successful push of the branch), or - Update an existing review app using
update_review_app.sh
- Once CI is complete follow this step to setup DNS.
First, make sure jq
is installed:
brew install jq
Then launch the script with:
./scripts/build_review_app.sh awesome-feature
The script will save a K8s spec in hokusai/awesome-feature.yml
To access the review app, you must create a DNS name for it. The name must match the name of the review app, and it must end in artsy.net
. So it must be awesome-feature.artsy.net
. This is required for full OAuth flow to complete. On Cloudflare, please do:
- Login to Cloudflare, and navigate to artsy.net > DNS
- Click
+ Add Record
- Change
Type
dropdown toCNAME
- Under
Name
enterawesome-feature
- Under
Target
saynginx-staging.artsy.net
- Under
Proxy status
toggle toProxied
- Under
Record Attributes > Comment
add the PR that created the review app, e.g. #123 - Under
Record Attributes > Tags
add the prefix of your team, e.g.FX
- Hit
Save
- DNS will propagate and after a few minutes the review app will be available via
awesome-feature.artsy.net
To set an ENV variable, run:
hokusai review_app env set <my-review-app-name> SOME_ENV_VAR=true
hokusai review_app refresh <my-review-app-name>
If the review app was created via Circle as mentioned above, simply push up your changes on the review-app-awesome-feature
branch.
If the app was built locally, do:
hokusai registry push --overwrite --skip-latest --force --tag awesome-feature
and redeploy the app:
hokusai review_app deploy awesome-feature awesome-feature
You should delete review apps as soon as QA is complete.
Delete the app by:
yarn delete-review-app awesome-feature
Delete its DNS entry by:
- Login to Cloudflare, and navigate to artsy.net > DNS
- In the search box, type
awesome-feature
- Locate the correct record in search results, hit
Edit
at end of line - Hit the
Delete
button on lower left
For more info on Review App maintenence, see Hokusai docs.
Read over the build_review_app.sh
script for more info on how this is all done.