This commit is contained in:
Vladislav 2026-07-22 17:10:46 -04:00
parent daca2d937c
commit 9c6edcaf8e

View File

@ -404,6 +404,20 @@
"!envsubst < k8s/gitea.yaml | kubectl apply -n gitea -f -"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "291b15a8",
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!echo "
]
},
{
"cell_type": "markdown",
"id": "35a1cf25",
@ -480,7 +494,83 @@
},
"outputs": [],
"source": [
"!rsync -avh --exclude-from=.rsyncignore --exclude=.venv/ . kultmost:/app/"
"!rsync -avh --exclude-from=.rsyncignore --exclude=.venv/ . kultmost:/app/$(git branch --show-current)/"
]
},
{
"cell_type": "markdown",
"id": "c49e0757",
"metadata": {},
"source": [
"### fastapi prod service"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b0a663d0",
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"%%bash\n",
"ssh kultmost 'tee /etc/systemd/system/production.service >/dev/null' <<'EOF'\n",
"[Unit]\n",
"Description=FastAPI prod service\n",
"After=network.target\n",
"\n",
"[Service]\n",
"WorkingDirectory=/app/production\n",
"ExecStart=/app/production/.venv/bin/uvicorn main:app --host 127.0.0.1 --port 30081 --workers 8\n",
"Restart=always\n",
"EnvironmentFile=/app/production/env\n",
"\n",
"[Install]\n",
"WantedBy=default.target\n",
"EOF\n",
"\n",
"ssh kultmost 'systemctl daemon-reload && systemctl enable --now production.service && systemctl status --no-pager -l production.service'\n"
]
},
{
"cell_type": "markdown",
"id": "dfd8deed",
"metadata": {},
"source": [
"### fastapi stag service"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3b4f2998",
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"%%bash\n",
"ssh kultmost 'tee /etc/systemd/system/staging.service >/dev/null' <<'EOF'\n",
"[Unit]\n",
"Description=FastAPI stag service\n",
"After=network.target\n",
"\n",
"[Service]\n",
"WorkingDirectory=/app/staging\n",
"ExecStart=/app/staging/.venv/bin/uvicorn main:app --host 127.0.0.1 --port 30082 --reload\n",
"Restart=always\n",
"EnvironmentFile=/app/staging/env\n",
"\n",
"[Install]\n",
"WantedBy=default.target\n",
"EOF\n",
"\n",
"ssh kultmost 'systemctl daemon-reload && systemctl enable --now staging.service && systemctl status --no-pager -l staging.service'\n"
]
},
{