[Blog] Preparing
All checks were successful
ci/woodpecker/push/test_pipeline Pipeline was successful
All checks were successful
ci/woodpecker/push/test_pipeline Pipeline was successful
[+] Fastapi app init [+] Test ci pipeline
This commit is contained in:
10
.woodpecker/test_pipeline.yaml
Normal file
10
.woodpecker/test_pipeline.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: main
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: debian
|
||||||
|
commands:
|
||||||
|
- echo "This is the build step"
|
||||||
|
- echo "binary-data-123" > executable
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
# blog.pyaqa.ru
|
# blog.pyaqa.ru
|
||||||
|
|
||||||
Блог pyaqa
|
Блог pyaqa
|
||||||
|
|
||||||
|
[](https://cicd.pyaqa.ru/repos/2)
|
||||||
|
|||||||
18
main.py
18
main.py
@@ -1,5 +1,21 @@
|
|||||||
|
import uvicorn
|
||||||
|
from fastapi import FastAPI
|
||||||
|
from contextlib import asynccontextmanager
|
||||||
|
|
||||||
|
|
||||||
|
@asynccontextmanager
|
||||||
|
async def lifespan(app: FastAPI):
|
||||||
|
yield
|
||||||
|
|
||||||
|
|
||||||
|
def app_factory():
|
||||||
|
app = FastAPI(lifespan=lifespan)
|
||||||
|
return app
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("Hello from blog!")
|
uvicorn.run(app_factory, factory=True, host="0.0.0.0", port=8000)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -4,4 +4,7 @@ version = "0.1.0"
|
|||||||
description = "Add your description here"
|
description = "Add your description here"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
dependencies = []
|
dependencies = [
|
||||||
|
"fastapi[standart]>=0.136.0",
|
||||||
|
"uvicorn>=0.44.0",
|
||||||
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user