Skip to content

Commit

Permalink
This isn't how any of this is deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jul 4, 2024
1 parent 546cfae commit 1a1bf88
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,4 @@ def dev(ctx, host="127.0.0.1", port=8000):
)


@fl.task(
auto_shortflags=False,
help={"force": "Force the git push"},
)
def deploy(ctx, force=False):
fl._check_branch(ctx)
fl._check_no_uncommitted_changes(ctx)
fl.check(ctx)
force = "--force-with-lease " if (force or fl.config.force) else ""
fl.run_local(ctx, f"git push origin {force}{fl.config.branch}")
fl.run_local(ctx, "yarn run rsbuild build")

with fl.Connection(fl.config.host) as conn, conn.cd(fl.config.domain):
fl._deploy_sync_origin_url(ctx, conn)
fl._deploy_django(conn)
fl.run(
conn,
"if [ -e static ]; then find static/ -type f -mtime +60 -delete;fi",
)
fl.run_local(
ctx,
f"rsync -pthrz --stats tmp/dist/static/ {fl.config.host}:{fl.config.domain}/static/",
)
fl._deploy_staticfiles(conn)
fl._nine_restart(conn)

fl.fetch(ctx)
fl.progress(f"Successfully deployed the {fl.config.environment} environment.")


ns = fl.Collection(*fl.GENERAL, dev, deploy)
ns = fl.Collection(*fl.GENERAL, dev)

0 comments on commit 1a1bf88

Please sign in to comment.