This page applies to Dash Enterprise 4.
Review apps are pre-release versions of your Dash apps that are automatically
created by your CI platform when making a pull request.
These apps inherit the configuration options of their production equivalent,
ensuring parity between environments for testing and QA. Review apps enable you to
quickly deploy and share proposed changes with the rest of your team before
merging them into production.
This chapter will cover:
To get started you will need:
You can download the scripts from the Dash Enterprise Review App Repo
Once configured, the Review App scripts that run on your CI system will:
To set up review apps, complete the following steps:
Depending on your CI platform, you may need to modify certain steps.
.circleci/config.yml
..review-apps
folder from Plotly’s GitHub to the root your project folder..review-apps
folder, update the following variables in the settings.py
file. See more details in the comments in settings.py
:DASH_ENTERPRISE_HOST
with your Dash Enterprise host address.MAIN_BRANCHNAME
with the name of the branch from where you will be pushing changes to your main app.REVIEW_BRANCHNAME
with the branch name as provided by a CI environment variable.MAIN_APP
with the name of the app you want to base your review apps on.SERVICE_API_KEY
with the environment variable containing your service account API key.SERVICE_PRIVATE_SSH_KEY
with the environment variable containing your service account private SSH key.DE_USERNAME_TO_CI_API_KEY
with the Dash Enterprise usernames and the corresponding API keys of the developers you want to deploy review apps.DE_USERNAME_TO_CI_USERNAME
with the Dash Enterprise usernames and the corresponding CI platform usernames.CI_USERNAME
with the CI platform login of the user pushing code to your version control system.TIME_UNIT
with the time unit (e.g. “days”) and TIMESPAN
with the amount of time a review app can remain deployed since its last update..circleci/config.yml
for an example using CircleCI’s configuration.python initialize.py
and python deploy.py
when commits are made on other branches to initialize Review App on Dash Enterprise and deploy the changes from the branch to that app.After setting up, review apps will get automatically created anytime you make a pull request from your review app branch. When pull request are merged, those approved changes get deployed to your main app branch.
To run the Review App scripts locally you will need to:
Create an .env
file.
Add and export the following environment variables and corresponding values:
YOUR_DEVELOPER_USERNAME_API_KEY
SERVICE_API_KEY
SERVICE_PRIVATE_SSH_KEY
SERVICE_SSH_CONFIG
bash
export YOUR_DEVELOPER_USERNAME_API_KEY="7WvY4f4e3chyEd272492"
export SERVICE_API_KEY="K4gvY4uO2yEaxSZrEHar"
export SERVICE_SSH_KEY="T2djU3YvSEVkbVZFT [...] 3BEdjBuNFhCUjYrT1pLRXUvUV"
export SERVICE_SSH_CONFIG="SG9c2gvzdCAqCiAgIC [...] DMwMjIKICAgIElkZW50aXR5R"
Create a virtual environment, activate it and install script dependencies:
For example:
bash
cd review-apps/
virtualenv -p /usr/bin/python3.6 venv
source ./venv/bin/activate
./venv/bin/python3.6 -m pip install ci-requirements.txt
Load environment variables from the .env
file and run the scripts together or individually:
```bash
source .env
python3.6 initialize.py; python3.6 deploy.py; python3.6 delete.py
```
To automate review app deployment with CircleCI, in addition to the setup steps you will need to:
review-apps
folder containing Review App scripts..circleci
folder containing your CircleCI configuration file.To use CircleCI you need to be using either GitHub or Bitbucket for your version control system (VCS).
Your app repository is automatically configured when you provide CircleCI with
a VCS API key and push changes to it. See CircleCI GitHub Integration Overview for more details.