-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix typo * Fix popover example * Add literature on testing * Add example tests * Add running instructions * Add comments about dashboard permission (#188) * Add few lines on permissions * Update image link url * Add link to code * Fix grammar * update and extend the managed platford docs (#194) * Add mocking docs * Add link to mock documentation * Added apostrophe * Added react testing to TOC * update import order to put React at the top (#198)
- Loading branch information
Showing
9 changed files
with
324 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,57 @@ | ||
# Managed | ||
# Managed Platform | ||
|
||
Reaction Commerce offers managed deployments for Reaction. The `reaction-cli` incorporates functionality for any team to deploy Reaction to multiple environments. | ||
Reaction Commerce offers managed deployments for Reaction. The `reaction-cli` incorporates functionality for any team to deploy Reaction to multiple environments. [Contact us](https://reactioncommerce.com/#get-a-demo) to get a demo or request an invite. | ||
|
||
`Launchdock` is the name of our registration gateway for the managed platform. | ||
|
||
## reaction register | ||
## Register/Login | ||
|
||
As a user of the Reaction managed platform, you'll receive an email with a `Launchdock` registration token. | ||
As a user of the Reaction managed platform, you'll receive an email with a `Launchdock` registration token. You will be asked for this token when you register with `reaction-cli`. | ||
|
||
**Register as a platform user** | ||
|
||
```sh | ||
# Register with invite token | ||
reaction register | ||
|
||
# or if you've already registered, login with your username and password | ||
reaction login | ||
``` | ||
|
||
## Apps | ||
|
||
### Deployment | ||
|
||
There are two ways you can deploy your apps with Launchdock. The first is by using a prebuilt image that is hosted somewhere like [Docker Hub](https://hub.docker.com/) and the second is by pushing your custom code to our build servers where they will create a custom Docker image and deploy it. Below are examples of both scenarios. | ||
|
||
**Deploy with a prebuilt Docker image** | ||
|
||
```sh | ||
# Create and configure your new app deployment | ||
reaction apps create \ | ||
--name <appname> \ | ||
--no-remote \ | ||
-e REACTION_USER="yourname" \ | ||
-e REACTION_AUTH="P@s5w0rd" \ | ||
-e REACTION_EMAIL="[email protected]" \ | ||
--registry path/to/reaction.json \ | ||
--settings path/to/settings.json | ||
|
||
# Deploy your pre-built image | ||
reaction deploy --name <appname> --image myorg/myapp:v1.1.0 | ||
|
||
# To deploy an updated version of your image, | ||
# simply run the command again with your new image tag | ||
reaction deploy --name <appname> --image myorg/myapp:v1.1.1 | ||
``` | ||
|
||
**Set up an SSH key pair to securely communicate with Launchdock** | ||
**Deploy a custom build** | ||
|
||
Custom builds are pushed to Launchdock using git. It's essentially the same as doing a `git push` to Github. The only difference from the commands above is you omit the `--no-remote` flag and you don't need to specify an `--image` because you'll be building a custom image. That said, there are a few more setup steps required to push custom code. | ||
|
||
First, you will need to set up an SSH key to securely communicate with Launchdock. | ||
|
||
Set up an SSH key pair: | ||
|
||
```sh | ||
# https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ | ||
|
@@ -35,53 +71,111 @@ ssh-add -K ~/.ssh/<private key created above> | |
reaction keys add ~/.ssh/<keyname>.pub | ||
``` | ||
|
||
## reaction create | ||
|
||
**Create an app from a prebuilt image** | ||
Then from your Reaction project directory: | ||
|
||
```sh | ||
reaction apps create --name <appname> --image myorg/myapp:v1.0.0 | ||
# This adds a git remote called 'launchdock-<appname>' to your project | ||
reaction apps create \ | ||
--name <appname> \ | ||
-e REACTION_USER="yourname" \ | ||
-e REACTION_AUTH="P@s5w0rd" \ | ||
-e REACTION_EMAIL="[email protected]" \ | ||
--registry path/to/reaction.json \ | ||
--settings path/to/settings.json | ||
|
||
# Push your custom code and start a new build | ||
reaction deploy --name <appname> | ||
|
||
# To deploy an updated version of your pre-built image | ||
reaction deploy --name <appname> --image myorg/myapp:v1.1.0 | ||
# To build/deploy an updated version of your code, | ||
# commit changes to your current branch | ||
git commit -m "updated some code" | ||
# and run the deploy command again | ||
reaction deploy --name <appname> | ||
``` | ||
|
||
**Or run a custom build** | ||
### Configuration | ||
|
||
**Environment Variables** | ||
|
||
```sh | ||
# (Must be in a Reaction project dir. This adds a git remote called 'launchdock-<appname>' to your project) | ||
reaction apps create --name <appname> | ||
# Push your custom code and start a build | ||
reaction deploy --name <appname> | ||
# set/update environment variables | ||
# (this triggers a redeploy of your app) | ||
reaction env set \ | ||
--app <appname> \ | ||
-e SOME_API_KEY="ec89jmur3jim8e34" \ | ||
-e SOME_OTHER_THING="dj8dr34ju3r@#$" \ | ||
-e MAIL_URL="smtp://USERNAME:PASSWORD@NEW_HOST:PORT" | ||
|
||
# unset environment variables | ||
# (this triggers a redeploy of your app) | ||
reaction env unset --app <appname> -e SOME_API_KEY -e SOME_OTHER_THING | ||
|
||
# list your currently set environment variables | ||
reaction env list --app <appname> | ||
``` | ||
|
||
## reaction deploy | ||
**Domains** | ||
|
||
```sh | ||
# Push your custom code and start a build | ||
reaction deploy --name <appname> | ||
# add a custom domain for your app | ||
# (first, update your DNS to point your domain at your app's default URL) | ||
reaction domains add --app <appname> -d mycoolshop.com | ||
|
||
# remove a custom domain from your app | ||
reaction domains remove --app <appname> -d mycoolshop.com | ||
|
||
# list your apps and their domains | ||
reaction apps list | ||
``` | ||
|
||
**Example deployment** | ||
## Basic Example | ||
|
||
An example deployment with a custom smtp server and preconfigured settings deploying the latest Reaction image from Docker Hub. | ||
Below is an example deployment using the latest official Reaction image from [Docker Hub](https://hub.docker.com/) and only setting the minimum required settings. | ||
|
||
```sh | ||
reaction apps create --name demo | ||
reaction env set \ | ||
--app demo \ | ||
-e REACTION_EMAIL="[email protected]" \ | ||
-e REACTION_USER="Administrator" \ | ||
-e REACTION_AUTH="PaSSw0Rd" \ | ||
-e MAIL_URL="smtp://USERNAME:PASSWORD@HOST:PORT" | ||
# create the app | ||
reaction apps create \ | ||
--name simple-demo \ | ||
--no-remote \ | ||
-e REACTION_USER="yourname" \ | ||
-e REACTION_AUTH="P@s5w0rd" \ | ||
-e REACTION_EMAIL="[email protected]" | ||
|
||
# deploy a Docker image | ||
reaction deploy --app simple-demo --image reactioncommerce/reaction:latest | ||
|
||
# open your app in your browser | ||
reaction open simple-demo | ||
``` | ||
|
||
## Full Example | ||
|
||
reaction deploy \ | ||
--name demo \ | ||
--image reactioncommerce/reaction:latest \ | ||
--registry ../config/reaction.json \ | ||
--settings ../config/settings.json | ||
Below is a more complete example that sets up a SMTP mail server URL (for app emails), imports [Reaction registry](https://docs.reactioncommerce.com/reaction-docs/master/registry) settings and [Meteor settings](https://docs.meteor.com/api/core.html#Meteor-settings), and deploys the latest official Reaction image. Then we update the app with an API key environment variable. And finally, we add a custom domain to the app and open it in our browser. | ||
|
||
reaction domains add -a demo -d demo.yourdomain.com | ||
reaction open -n demo | ||
```sh | ||
# create the app | ||
reaction apps create \ | ||
--name full-demo \ | ||
--no-remote \ | ||
-e REACTION_USER="yourname" \ | ||
-e REACTION_AUTH="P@s5w0rd" \ | ||
-e REACTION_EMAIL="[email protected]" \ | ||
-e MAIL_URL="smtp://USERNAME:PASSWORD@NEW_HOST:PORT" \ | ||
--registry private/settings/reaction.json \ | ||
--settings settings/settings.json | ||
|
||
# deploy a Docker image | ||
reaction deploy --app full-demo --image reactioncommerce/reaction:latest | ||
|
||
# set/update an environment variable | ||
reaction env set --app full-demo -e SOME_API_KEY="<secret API key>" | ||
|
||
# add a custom domain | ||
reaction domains add --app full-demo --domain mycoolshop.com | ||
|
||
# list your apps to confirm your configuration, URL's, etc. | ||
reaction apps list | ||
|
||
# open your app in your browser | ||
reaction open full-demo | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.