not yet
This commit is contained in:
parent
7645d83c51
commit
dce21d4ad0
0
.drone.yml
Normal file
0
.drone.yml
Normal file
90
README.md
90
README.md
@ -0,0 +1,90 @@
|
||||
|
||||
# Table of Contents
|
||||
1. [Логика доступа к контенту ](#Логика-доступа-к-контенту)
|
||||
1. [Логика деплоя в куб по коммиту ](#Логика-деплоя-в-куб-по-коммиту)
|
||||
|
||||
|
||||
Вообще суть такова:
|
||||
Мы берём фласк, кидаем в контейнер, далее контейнер педалим в кубернетес в деплоймент соответствующий ветке (мастер/дев) с 2-3 подами на деплоймент, всё это должен уметь делать CI/CD
|
||||
|
||||
|
||||
----
|
||||
|
||||
## Логика доступа к контенту
|
||||
|
||||
|
||||
```mermaid
|
||||
stateDiagram-v2
|
||||
|
||||
state USER
|
||||
state inet <<join>>
|
||||
|
||||
state Nginx
|
||||
|
||||
user --> inet : internet
|
||||
inet --> Nginx : router
|
||||
|
||||
state Kube {
|
||||
|
||||
NginxIngress
|
||||
|
||||
lbServiceMaster
|
||||
lbServiceDev
|
||||
|
||||
|
||||
state DeploymentMaster {
|
||||
state "pod" as p1
|
||||
state "pod" as p2
|
||||
}
|
||||
state DeploymentDev {
|
||||
state "pod" as p1d
|
||||
state "pod" as p2d
|
||||
}
|
||||
}
|
||||
|
||||
Nginx --> NginxIngress : *.board.vdk2ch.ru, www.vdk2ch.ru
|
||||
|
||||
NginxIngress --> lbServiceMaster : master.board.vdk2ch.ru
|
||||
NginxIngress --> lbServiceDev : dev.board.vdk2ch.ru
|
||||
|
||||
|
||||
lbServiceMaster --> DeploymentMaster
|
||||
lbServiceMaster --> DeploymentMaster
|
||||
|
||||
lbServiceDev --> DeploymentDev
|
||||
lbServiceDev --> DeploymentDev
|
||||
|
||||
state Minio
|
||||
state Postgresql
|
||||
|
||||
state all_join <<join>>
|
||||
|
||||
p1 --> all_join
|
||||
p2 --> all_join
|
||||
p1d --> all_join
|
||||
p2d --> all_join
|
||||
|
||||
p1 --> all_join
|
||||
|
||||
all_join --> Postgres : данные с БД
|
||||
all_join --> Minio : статика
|
||||
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
## Логика деплоя в куб по коммиту
|
||||
|
||||
TBA
|
||||
|
||||
|
||||
```mermaid
|
||||
stateDiagram-v2
|
||||
|
||||
Git
|
||||
committer
|
||||
Docker
|
||||
Kube
|
||||
Drone
|
||||
|
||||
```
|
27
app.py
Normal file
27
app.py
Normal file
@ -0,0 +1,27 @@
|
||||
from flask import Flask, render_template, request
|
||||
from flask_assets import Bundle, Environment
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
assets = Environment(app)
|
||||
#css = Bundle("src/main.css", output="dist/main.css")
|
||||
|
||||
# https://unpkg.com/htmx.org
|
||||
js = Bundle("src/*.js", output="dist/main.js")
|
||||
|
||||
#assets.register("css", css)
|
||||
assets.register("js", js)
|
||||
#css.build()
|
||||
js.build()
|
||||
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def homepage():
|
||||
return render_template("page1.html")
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
BIN
static/.webassets-cache/8c84df14289a035a76f81d7b0a3d4005
Normal file
BIN
static/.webassets-cache/8c84df14289a035a76f81d7b0a3d4005
Normal file
Binary file not shown.
BIN
static/.webassets-cache/bbecb40acf7492b5144d90976cc67d1d
Normal file
BIN
static/.webassets-cache/bbecb40acf7492b5144d90976cc67d1d
Normal file
Binary file not shown.
3566
static/dist/main.js
vendored
Normal file
3566
static/dist/main.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3566
static/src/htmx.js
Normal file
3566
static/src/htmx.js
Normal file
File diff suppressed because it is too large
Load Diff
23
templates/base.html
Normal file
23
templates/base.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!--
|
||||
{% assets 'css' %}
|
||||
<link rel="stylesheet" href="{{ ASSET_URL }}">
|
||||
{% endassets %} -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/purecss@3.0.0/build/pure-min.css" integrity="sha384-X38yfunGUhNzHpBaEBsWLO+A0HDYOQi8ufWDkZ0k9e0eXz/tH3II7uKZ9msv++Ls" crossorigin="anonymous">
|
||||
|
||||
{% assets 'js' %}
|
||||
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
||||
{% endassets %}
|
||||
|
||||
<title>Flask + htmx</title>
|
||||
</head>
|
||||
<body class="bg-blue-100">
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</body>
|
||||
</html>
|
32
templates/page1.html
Normal file
32
templates/page1.html
Normal file
@ -0,0 +1,32 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="w-small w-2/3 mx-auto py-10 text-gray-600">
|
||||
<input
|
||||
type="text"
|
||||
name="search"
|
||||
hx-post="/search"
|
||||
hx-trigger="keyup changed delay:250ms"
|
||||
hx-indicator=".htmx-indicator"
|
||||
hx-target="#todo-results"
|
||||
placeholder="Search"
|
||||
class="bg-white h-10 px-5 pr-10 rounded-full text-2xl focus:outline-none"
|
||||
>
|
||||
<span class="htmx-indicator">Searching...</span>
|
||||
</div>
|
||||
suppss
|
||||
|
||||
|
||||
<table class="border-collapse w-small w-2/3 mx-auto">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">#</th>
|
||||
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">Title</th>
|
||||
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">Completed</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="todo-results">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock content %}
|
Loading…
Reference in New Issue
Block a user