Created
August 12, 2020 02:09
-
-
Save nabla-c0d3/1606993b9ea4a0b97a3b02eaf05f41ba to your computer and use it in GitHub Desktop.
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
import time | |
from invoke import task, Context | |
CMD_COMPOSE = "docker-compose -f docker-compose.dev.yml" | |
CMD_RUN_APP = f"{CMD_COMPOSE} run --rm app" | |
@task | |
def build(ctx): | |
# type: (Context) -> None | |
ctx.run(f"{CMD_COMPOSE} build") | |
@task | |
def upgrade(ctx): | |
# type: (Context) -> None | |
build(ctx) | |
ctx.run(f"{CMD_COMPOSE} up -d postgres elasticsearch") | |
time.sleep(10) | |
ctx.run(f"{CMD_RUN_APP} aleph upgrade") | |
@task | |
def services(ctx): | |
# type: (Context) -> None | |
ctx.run(f"{CMD_COMPOSE} up -d --remove-orphans postgres elasticsearch ingest-file convert-document") | |
@task | |
def web(ctx): | |
# type: (Context) -> None | |
services(ctx) | |
ctx.run(f"{CMD_COMPOSE} up api ui") | |
@task | |
def all(ctx): | |
# type: (Context) -> None | |
build(ctx) | |
upgrade(ctx) | |
web(ctx) | |
@task | |
def test(ctx): | |
# type: (Context) -> None | |
ctx.run(f"{CMD_RUN_APP} contrib/test.sh") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment