diff --git a/README.md b/README.md index b3dc32a320f..24464567db5 100755 --- a/README.md +++ b/README.md @@ -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` diff --git a/tasks.py b/tasks.py index fd2e9f45026..1524d72f728 100644 --- a/tasks.py +++ b/tasks.py @@ -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")