hore
This commit is contained in:
parent
188047e1b6
commit
3b8bb044fe
120
build.ipynb
120
build.ipynb
@ -1,5 +1,13 @@
|
|||||||
{
|
{
|
||||||
"cells": [
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "20340e34",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## BUILD"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@ -114,6 +122,55 @@
|
|||||||
" load_env('env_example')"
|
" load_env('env_example')"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "74d7ec58",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### build (ipynb -> py)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 1,
|
||||||
|
"id": "2809c42c",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import json\n",
|
||||||
|
"import os\n",
|
||||||
|
"\n",
|
||||||
|
"IGNORE = ['build.ipynb', 'data.ipynb', 'migrate.ipynb']\n",
|
||||||
|
"def build():\n",
|
||||||
|
" for _filename in [i for i in os.listdir() if 'ipynb' in i and i not in IGNORE]:\n",
|
||||||
|
" filename_without_extension = os.path.splitext(os.path.basename(_filename))[0]\n",
|
||||||
|
"\n",
|
||||||
|
" with open(f'{filename_without_extension}.ipynb', 'r') as f:\n",
|
||||||
|
" data = f.read()\n",
|
||||||
|
" main = json.loads(data)\n",
|
||||||
|
" app = []\n",
|
||||||
|
" for cell in main['cells']:\n",
|
||||||
|
" if '## Run' in cell['source']:\n",
|
||||||
|
" break\n",
|
||||||
|
" if '# ignore\\n' in cell['source']:\n",
|
||||||
|
" continue\n",
|
||||||
|
" app.append(''.join(cell['source']))\n",
|
||||||
|
"\n",
|
||||||
|
" with open(f'{filename_without_extension}.py', 'w') as f:\n",
|
||||||
|
" f.write(f\"# `{filename_without_extension}.py` generate from `{filename_without_extension}.ipynb` by `build.ipynb` \\n\")\n",
|
||||||
|
" f.write('\\n\\n'.join(app))\n",
|
||||||
|
"\n",
|
||||||
|
"build()"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "0490beed",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## KUBECTL / DOCKER"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "d0947a0b",
|
"id": "d0947a0b",
|
||||||
@ -219,47 +276,6 @@
|
|||||||
"!docker pull $REGISTRY_HOST/python:3.13-slim"
|
"!docker pull $REGISTRY_HOST/python:3.13-slim"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"cell_type": "markdown",
|
|
||||||
"id": "74d7ec58",
|
|
||||||
"metadata": {},
|
|
||||||
"source": [
|
|
||||||
"### build (ipynb -> py)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 1,
|
|
||||||
"id": "2809c42c",
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"import json\n",
|
|
||||||
"import os\n",
|
|
||||||
"\n",
|
|
||||||
"IGNORE = ['build.ipynb', 'data.ipynb', 'migrate.ipynb']\n",
|
|
||||||
"def build():\n",
|
|
||||||
" for _filename in [i for i in os.listdir() if 'ipynb' in i and i not in IGNORE]:\n",
|
|
||||||
" filename_without_extension = os.path.splitext(os.path.basename(_filename))[0]\n",
|
|
||||||
"\n",
|
|
||||||
" with open(f'{filename_without_extension}.ipynb', 'r') as f:\n",
|
|
||||||
" data = f.read()\n",
|
|
||||||
" main = json.loads(data)\n",
|
|
||||||
" app = []\n",
|
|
||||||
" for cell in main['cells']:\n",
|
|
||||||
" if '## Run' in cell['source']:\n",
|
|
||||||
" break\n",
|
|
||||||
" if '# ignore\\n' in cell['source']:\n",
|
|
||||||
" continue\n",
|
|
||||||
" app.append(''.join(cell['source']))\n",
|
|
||||||
"\n",
|
|
||||||
" with open(f'{filename_without_extension}.py', 'w') as f:\n",
|
|
||||||
" f.write(f\"# `{filename_without_extension}.py` generate from `{filename_without_extension}.ipynb` by `build.ipynb` \\n\")\n",
|
|
||||||
" f.write('\\n\\n'.join(app))\n",
|
|
||||||
"\n",
|
|
||||||
"build()"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "fef1918f",
|
"id": "fef1918f",
|
||||||
@ -268,16 +284,6 @@
|
|||||||
"### tg build"
|
"### tg build"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "4489de4b",
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"!docker tag mongo:latest registry.spiritofweb.ru/mongo:latest"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@ -650,6 +656,14 @@
|
|||||||
"echo \"history -w\""
|
"echo \"history -w\""
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "bbb93664",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## RSYNC"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "0a429fca",
|
"id": "0a429fca",
|
||||||
@ -1117,7 +1131,7 @@
|
|||||||
"id": "a26138d2",
|
"id": "a26138d2",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"### microk8s"
|
"## microk8s"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1158,7 +1172,7 @@
|
|||||||
"id": "622f00a3",
|
"id": "622f00a3",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"### Figma"
|
"## Figma"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user