Selaa lähdekoodia

Deployment script

master
David Larlet 5 vuotta sitten
vanhempi
commit
6f6da392ca
No known key found for this signature in database
2 muutettua tiedostoa jossa 14 lisäystä ja 4 poistoa
  1. 13
    4
      famille.py
  2. 1
    0
      requirements.txt

+ 13
- 4
famille.py Näytä tiedosto

@@ -6,9 +6,10 @@ from pathlib import Path
from time import perf_counter

import markdown
import minicli
from jinja2 import Environment as Env
from jinja2 import FileSystemLoader
from minicli import cli, run, wrap
from usine import connect, run

HERE = Path(".")
FAMILLE = HERE / "famille"
@@ -39,14 +40,21 @@ def collection():
)


@cli
@minicli.cli
def generate():
template = environment.get_template("histoire.html")
page = template.render(chapters=collection())
open(FAMILLE / "histoire" / "index.html", "w").write(page)


@wrap
@minicli.cli
def deploy():
repository = "gitea-repositories/davidbgk/larlet-fr-famille.git"
run(f"git archive --remote={repository} master | tar -x -C larlet-fr/famille")
print("Deployment done.")


@minicli.wrap
def perf_wrapper():
start = perf_counter()
yield
@@ -55,4 +63,5 @@ def perf_wrapper():


if __name__ == "__main__":
run()
with connect(hostname="larlet@ssh-larlet.alwaysdata.net"):
minicli.run()

+ 1
- 0
requirements.txt Näytä tiedosto

@@ -1,3 +1,4 @@
Jinja2==2.10.3
Markdown==3.1.1
minicli==0.4.4
usine==0.2.2

Loading…
Peruuta
Tallenna