forked from fediversity/fediversity
Compare commits
2 commits
1983508fb1
...
45c53ec150
| Author | SHA1 | Date | |
|---|---|---|---|
| 45c53ec150 | |||
| 60093212d7 |
5 changed files with 3 additions and 24 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -12,4 +12,3 @@ result*
|
|||
*screenshot.png
|
||||
output
|
||||
todo
|
||||
log/
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ in
|
|||
DATABASE_URL = "sqlite:///${toString ./src}/db.sqlite3";
|
||||
# locally: use a fixed relative reference, so we can use our newest files without copying to the store
|
||||
REPO_DIR = toString ../.;
|
||||
LOGGING_DIR = "../log";
|
||||
};
|
||||
shellHook = ''
|
||||
ln -sf ${sources.htmx}/dist/htmx.js src/panel/static/htmx.min.js
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ let
|
|||
(builtins.toFile "extra-settings.py" cfg.extra-settings)
|
||||
];
|
||||
REPO_DIR = import ../../launch/tf-env.nix { inherit lib pkgs; };
|
||||
LOGGING_DIR = "/var/log/${name}";
|
||||
SSH_PRIVATE_KEY_FILE = config.age.secrets.panel-ssh-key.path;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -176,9 +176,6 @@ COMPRESS_PRECOMPILERS = [
|
|||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
logging_dir = env["LOGGING_DIR"]
|
||||
os.makedirs(logging_dir, mode=0o700, exist_ok=True)
|
||||
|
||||
LOGGING = {
|
||||
"version": 1,
|
||||
"disable_existing_loggers": False,
|
||||
|
|
@ -217,24 +214,15 @@ LOGGING = {
|
|||
"filters": ["require_debug_false"],
|
||||
"class": "django.utils.log.AdminEmailHandler",
|
||||
},
|
||||
"file": {
|
||||
"level": "INFO",
|
||||
"class": "logging.FileHandler",
|
||||
"filename": f"{logging_dir}/info.log",
|
||||
},
|
||||
},
|
||||
"loggers": {
|
||||
"": {
|
||||
"handlers": ["console", "file"],
|
||||
"handlers": ["console"],
|
||||
"level": "DEBUG" if DEBUG else "INFO",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
SECONDS_PER_MINUTE = 60
|
||||
DEPLOY_TIMEOUT_MINUTES = 25
|
||||
DEPLOY_TIMEOUT_SECONDS = DEPLOY_TIMEOUT_MINUTES * SECONDS_PER_MINUTE
|
||||
|
||||
# Customization via user settings
|
||||
# This must be at the end, as it must be able to override the above
|
||||
# TODO(@fricklerhandwerk):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
from enum import Enum
|
||||
import json
|
||||
from os.path import expanduser
|
||||
from subprocess import Popen, PIPE, STDOUT
|
||||
import subprocess
|
||||
import logging
|
||||
import os
|
||||
|
|
@ -161,11 +160,6 @@ class DeploymentStatus(ConfigurationForm):
|
|||
"--auto-approve",
|
||||
"-lock=false",
|
||||
]
|
||||
popen = Popen(cmd, cwd=cwd, env=env, stdout=PIPE, stderr=STDOUT)
|
||||
with popen.stdout:
|
||||
for line in iter(popen.stdout.readline, b''):
|
||||
logger.info(line.decode('utf-8').strip())
|
||||
# FIXME catch subprocess.TimeoutExpired
|
||||
deployment_result = popen.wait(timeout=settings.DEPLOY_TIMEOUT_SECONDS)
|
||||
logger.info(f"deployment_result: {deployment_result}")
|
||||
deployment_result = subprocess.run(cmd, cwd=cwd, env=env)
|
||||
logging.info(deployment_result)
|
||||
return deployment_result, deployment_params
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue