Skip to content

Commit

Permalink
Merge ef62393 into bd50ca2
Browse files Browse the repository at this point in the history
  • Loading branch information
patjouk committed Jul 3, 2018
2 parents bd50ca2 + ef62393 commit 02f61dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -55,6 +55,7 @@ But it's a bit long. So instead, you can use invoke:
- `inv runserver`: Start a web server
- `inv setup`: Prepare your dev environment after a fresh git clone
- `inv test`: Run tests
- `inv catch-up`: Install dependencies and apply migrations

For management commands not covered by an invoke tasks, use `inv manage [command]` (example: `inv manage load_fake_data`). You can pass flag and options to management commands using `inv manage [command] -o [positional argument] -f [optional argument]`. For example:
- `inv manage runserver -o 3000`
Expand Down
14 changes: 12 additions & 2 deletions tasks.py
Expand Up @@ -65,17 +65,27 @@ def setup(ctx):
print("Installing npm dependencies and build.")
ctx.run("npm install && npm run build")
print("Installing Python dependencies.")
ctx.run("pipenv install --dev", **PLATFORM_ARG)
ctx.run("pipenv install --dev")
print("Applying database migrations.")
ctx.run("inv migrate")
print("Creating fake data")
ctx.run("inv manage load_fake_data")
print("Creating superuser.")
# Windows doesn't support pty, skipping this step
if platform == 'win32':
print("All done!\n"
"To create an admin user: pipenv run python network-api/manage.py createsuperuser\n"
"To start your dev server: inv runserver")
else:
print("Creating superuser.")
ctx.run("pipenv run python network-api/manage.py createsuperuser", pty=True)
print("All done! To start your dev server, run the following:\n inv runserver")

@task
def catch_up(ctx):
"""Install dependencies and apply migrations"""
print("Installing npm dependencies and build.")
ctx.run("npm install && npm run build")
print("Installing Python dependencies.")
ctx.run("pipenv install --dev")
print("Applying database migrations.")
ctx.run("inv migrate")

0 comments on commit 02f61dc

Please sign in to comment.