Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize Django module for one-off management commands #1

Closed
wants to merge 14 commits into from
Prev Previous commit
Next Next commit
Clean up README
Add additional notes and context to the README.
  • Loading branch information
jeancochrane authored Mar 2, 2019
commit 80c3ba5af142438be9eefa1d527ad4fe78fe3f20
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ A Django app that provides a management command allowing you to run any
other management command on an AWS Elastic Container Service
(ECS) cluster.

Useful for running migrations and other one-off commands in staging and
production environments. With `django-ecsmanage`, you can easily run migrations
With `django-ecsmanage`, you can easily run migrations and other one-off tasks
on a remote cluster from the command line:

```
Expand All @@ -22,10 +21,10 @@ $ django-admin ecsmanage migrate

## Installation

Install from GitHub using pip:
Install from PyPi using pip:

```
$ pip install git+https://github.com/azavea/django-ecsmanage.git
$ pip install django-ecsmanage
```

Update `INSTALLED_APPS` in your Django settings to install the app:
Expand All @@ -43,7 +42,7 @@ Settings for the management command are kept in a single configuration
dictionary in your Django settings named `ECSMANAGE_ENVIRONMENTS`. Each entry in
`ECSMANAGE_ENVIRONMENTS` should be a key-value pair corresponding to a
named environment (like `default` or `production`) and a set of AWS resources
in that environment. For example:
associated with that environment. For example:

```python
ECSMANAGE_ENVIRONMENTS = {
Expand All @@ -66,11 +65,14 @@ ECSMANAGE_ENVIRONMENTS = {
}
```

This configuration defines a single environment, named `default`, with
associated AWS ECS resources.

### Environments

The key name for an environment can be any string. You can use this name
with the `--env` flag when running the command to run a command on a
different environment. Take this `ECSMANAGE_ENVIRONMENTS` variable
different environment. Take this `ECSMANAGE_ENVIRONMENTS` configuration
as an example:

```python
Expand Down Expand Up @@ -98,6 +100,7 @@ ECSMANAGE_ENVIRONMENTS = {
}
```

This configuration defines two environments, `default` and `production`.
Using the above settings, you could run production migrations with the
following command:

Expand All @@ -110,7 +113,7 @@ environment named `default`.

### AWS Resources

The following keys in an environment help the management command locate
The following environment configuration keys help the management command locate
the appropriate AWS resources for your cluster:

| key name | description | default |
Expand Down Expand Up @@ -138,4 +141,4 @@ Run the tests:

```
$ ./scripts/test
```
```