This commit is contained in:
Vladislav 2026-07-20 14:29:15 -04:00
parent aec5a9735c
commit dc2d793dd9

View File

@ -111,7 +111,11 @@
"cell_type": "code",
"execution_count": null,
"id": "63d3463e",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!kubectl create secret docker-registry regcred --docker-server=$REGISTRY_HOST --docker-username='user' --docker-password=$REGISTRY_PASS --docker-email=\"$(git config --global --get user.email)\""
@ -121,7 +125,11 @@
"cell_type": "code",
"execution_count": null,
"id": "ff732fa4",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!docker login $REGISTRY_HOST -u 'user' -p $REGISTRY_PASS"
@ -139,7 +147,11 @@
"cell_type": "code",
"execution_count": null,
"id": "ff55c6cf",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!docker pull $REGISTRY_HOST/python:3.13-alpine"
@ -149,7 +161,11 @@
"cell_type": "code",
"execution_count": null,
"id": "34437078",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!docker pull $REGISTRY_HOST/python:3.13-slim"
@ -207,7 +223,11 @@
"cell_type": "code",
"execution_count": null,
"id": "d62a9efa",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!docker build -t $REGISTRY_HOST/avtopost-api:latest ."
@ -217,7 +237,11 @@
"cell_type": "code",
"execution_count": null,
"id": "fa6370f6",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!docker image push $REGISTRY_HOST/avtopost-api:latest"
@ -227,7 +251,11 @@
"cell_type": "code",
"execution_count": null,
"id": "0309c9b3",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!kubectl rollout restart deployments/kultmost-api -n kultmost"
@ -245,7 +273,11 @@
"cell_type": "code",
"execution_count": null,
"id": "8c359276",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!kubectl rollout restart deployments/vk-celery -n kultmost"
@ -255,7 +287,11 @@
"cell_type": "code",
"execution_count": null,
"id": "a75776f0",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!kubectl rollout restart deployments/email-celery -n kultmost"
@ -273,7 +309,11 @@
"cell_type": "code",
"execution_count": null,
"id": "496f4cc7",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!docker build -t $REGISTRY_HOST/ssh-tunnel:2 tunnel/\n",
@ -284,7 +324,11 @@
"cell_type": "code",
"execution_count": null,
"id": "4419ce48",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!kubectl create secret generic ssh-id-rsa --from-file=id_rsa=/home/user/.ssh/id_rsa -n kultmost"
@ -294,7 +338,11 @@
"cell_type": "code",
"execution_count": null,
"id": "aa7b001d",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!kubectl apply -n kultmost -f k8s/stunnel.yaml"
@ -304,7 +352,11 @@
"cell_type": "code",
"execution_count": null,
"id": "c472ba3a",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!envsubst < k8s/prod.yaml | kubectl apply -n kultmost -f -"
@ -314,7 +366,11 @@
"cell_type": "code",
"execution_count": null,
"id": "b8579fa2",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!envsubst < k8s/kultmost.yaml | kubectl apply -n kultmost -f -"
@ -324,7 +380,11 @@
"cell_type": "code",
"execution_count": null,
"id": "01c430ae",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!envsubst < k8s/mq.yaml | kubectl apply -n kultmost -f -"
@ -334,7 +394,11 @@
"cell_type": "code",
"execution_count": null,
"id": "598e0bc3",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!envsubst < k8s/gitea.yaml | kubectl apply -n gitea -f -"
@ -417,7 +481,11 @@
"cell_type": "code",
"execution_count": null,
"id": "ff536fb8",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"#!rsync -avz ./static kultmost:/var/www/static/"
@ -427,7 +495,11 @@
"cell_type": "code",
"execution_count": null,
"id": "3aba3afb",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!rsync -avh --exclude-from=.rsyncignore . /app/"
@ -437,7 +509,11 @@
"cell_type": "code",
"execution_count": null,
"id": "11c03751",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!rsync -avh --exclude-from=.rsyncignore --exclude=.venv/ /app/ kultmost:/app/"
@ -455,17 +531,25 @@
"cell_type": "code",
"execution_count": null,
"id": "001d41fe",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!ssh kultmost 'systemctl restart fastapi.service'\n"
"!ssh kultmost 'systemctl restart fastapi.service'"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8714f4cc",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!ssh kultmost 'systemctl status fastapi.service'"
@ -483,7 +567,11 @@
"cell_type": "code",
"execution_count": null,
"id": "3cc3fd1c",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!ssh kultmost 'systemctl restart vk-celery.service'"
@ -493,7 +581,11 @@
"cell_type": "code",
"execution_count": null,
"id": "3f77084c",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!ssh kultmost 'systemctl status vk-celery.service'"
@ -503,7 +595,11 @@
"cell_type": "code",
"execution_count": null,
"id": "68340709",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!ssh kultmost 'systemctl restart email-celery.service'"
@ -513,7 +609,11 @@
"cell_type": "code",
"execution_count": null,
"id": "d9285803",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!ssh kultmost 'systemctl status email-celery.service'"
@ -531,7 +631,11 @@
"cell_type": "code",
"execution_count": null,
"id": "003f0324",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"# !scp kultmost:/etc/nginx/sites-enabled/default nginx_conf "
@ -541,7 +645,11 @@
"cell_type": "code",
"execution_count": null,
"id": "dbfffccd",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!scp nginx_conf kultmost:/tmp/default\n",
@ -553,7 +661,11 @@
"cell_type": "code",
"execution_count": null,
"id": "f7d27751",
"metadata": {},
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!ssh kultmost 'nginx -s reload'"