Fix deps & add alive check

This commit is contained in:
Gabriel Augendre 2021-12-28 23:45:35 +01:00
parent 2793dc18a0
commit 42bcc4dd43
3 changed files with 18 additions and 4 deletions

6
poetry.lock generated
View file

@ -274,7 +274,7 @@ typing-extensions = "*"
name = "django-stubs-ext" name = "django-stubs-ext"
version = "0.3.1" version = "0.3.1"
description = "Monkey-patching and extensions for django-stubs" description = "Monkey-patching and extensions for django-stubs"
category = "dev" category = "main"
optional = false optional = false
python-versions = ">=3.6" python-versions = ">=3.6"
@ -880,7 +880,7 @@ python-versions = "*"
name = "typing-extensions" name = "typing-extensions"
version = "4.0.1" version = "4.0.1"
description = "Backported and Experimental Type Hints for Python 3.6+" description = "Backported and Experimental Type Hints for Python 3.6+"
category = "dev" category = "main"
optional = false optional = false
python-versions = ">=3.6" python-versions = ">=3.6"
@ -975,7 +975,7 @@ multidict = ">=4.0"
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = "^3.10" python-versions = "^3.10"
content-hash = "35d359b39bfd7c907a1119797a4badf33b3f3c964a5ec90e85c781cf99fecf7e" content-hash = "f98d2a4ae15821bd9d0247980743235129a22295abf136ae59f89568a329180e"
[metadata.files] [metadata.files]
asgiref = [ asgiref = [

View file

@ -24,6 +24,7 @@ django-csp = "^3.7"
django-two-factor-auth = {extras = ["phonenumberslite"], git = "https://github.com/Bouke/django-two-factor-auth.git", rev = "ffe4422e"} django-two-factor-auth = {extras = ["phonenumberslite"], git = "https://github.com/Bouke/django-two-factor-auth.git", rev = "ffe4422e"}
beautifulsoup4 = "^4.10.0" beautifulsoup4 = "^4.10.0"
django-environ = "^0.8.1" django-environ = "^0.8.1"
django-stubs-ext = "^0.3.1"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
pre-commit = "^2.7" pre-commit = "^2.7"

View file

@ -1,5 +1,7 @@
import time
from pathlib import Path from pathlib import Path
import requests
from invoke import task from invoke import task
BASE_DIR = Path(__file__).parent.resolve(strict=True) BASE_DIR = Path(__file__).parent.resolve(strict=True)
@ -56,7 +58,18 @@ def deploy(ctx):
ctx.run("ssh ubuntu /home/gaugendre/blog/update", pty=True, echo=True) ctx.run("ssh ubuntu /home/gaugendre/blog/update", pty=True, echo=True)
@task(pre=[check, build, publish, deploy]) @task
def check_alive(ctx):
for _ in range(5):
try:
res = requests.get("https://gabnotes.org")
res.raise_for_status()
except requests.exceptions.HTTPError:
time.sleep(1)
return
@task(pre=[check, build, publish, deploy], post=[check_alive])
def beam(ctx): def beam(ctx):
pass pass