-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfabfile.py
More file actions
42 lines (34 loc) · 1.09 KB
/
fabfile.py
File metadata and controls
42 lines (34 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from fabric import task
@task
def develop(context):
"""
Set up a development environment
"""
context.run("uv sync", replace_env=False, pty=True)
context.run("mkdir -p .mamerwiselen/powonline")
context.run("cp sample-files/app.ini .mamerwiselen/powonline/app.ini")
context.run("pre-commit install -f")
@task
def build_docker(ctx, datever, environment="staging"): # type: ignore
tag = f"registry.digitalocean.com/michel-albert/powonline-api:{datever}"
ctx.run(f"docker build -t {tag} .", replace_env=False, pty=True)
@task
def push(ctx, datever, environment="staging"): # type: ignore
tag = f"registry.digitalocean.com/michel-albert/powonline-api:{datever}"
ctx.run(f"docker push {tag}", pty=True, replace_env=False)
@task
def run(context):
"""
Run a development server
"""
context.run(
(
"uv run uvicorn "
"--reload "
"--log-level debug "
"--log-config .devcontainer/logging.yaml "
"--factory powonline.main:create_app"
),
replace_env=False,
pty=True,
)