Compare commits
6 Commits
751c9c5d52
...
9fc7a9449e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fc7a9449e | ||
| 7b18962033 | |||
|
|
3e15acbb9d | ||
|
|
2a660e9c19 | ||
| 4a4ed0ff2b | |||
|
|
65ad72c299 |
@ -51,6 +51,13 @@ docker build -t paper-dynasty-db . # Build image
|
||||
- DB connection errors → verify `POSTGRES_HOST` points to correct container name
|
||||
- **CI/CD**: Gitea Actions on PR to `main` — builds Docker image, auto-generates CalVer version (`YYYY.MM.BUILD`) on merge
|
||||
|
||||
### Release Workflow
|
||||
1. Create feature/fix branches off `next-release` (e.g., `fix/card-pricing`)
|
||||
2. When done, merge the branch into `next-release` — this is the staging branch where changes accumulate
|
||||
3. When ready to release, open a PR from `next-release` → `main`
|
||||
4. CI builds Docker image on PR; CalVer tag is created on merge
|
||||
5. Deploy the new image to production
|
||||
|
||||
## Important
|
||||
|
||||
- Docker image installs only Playwright Chromium (not all browsers) to optimize size
|
||||
|
||||
46
app/main.py
46
app/main.py
@ -6,15 +6,42 @@ from fastapi.openapi.utils import get_openapi
|
||||
# from fastapi.templating import Jinja2Templates
|
||||
|
||||
from .routers_v2 import (
|
||||
current, awards, teams, rarity, cardsets, players, packtypes, packs, cards, events, results, rewards, decisions,
|
||||
batstats, pitstats, notifications, paperdex, gamerewards, gauntletrewards, gauntletruns, battingcards,
|
||||
battingcardratings, pitchingcards, pitchingcardratings, cardpositions, scouting, mlbplayers, stratgame, stratplays)
|
||||
current,
|
||||
awards,
|
||||
teams,
|
||||
rarity,
|
||||
cardsets,
|
||||
players,
|
||||
packtypes,
|
||||
packs,
|
||||
cards,
|
||||
events,
|
||||
results,
|
||||
rewards,
|
||||
decisions,
|
||||
batstats,
|
||||
pitstats,
|
||||
notifications,
|
||||
paperdex,
|
||||
gamerewards,
|
||||
gauntletrewards,
|
||||
gauntletruns,
|
||||
battingcards,
|
||||
battingcardratings,
|
||||
pitchingcards,
|
||||
pitchingcardratings,
|
||||
cardpositions,
|
||||
scouting,
|
||||
mlbplayers,
|
||||
stratgame,
|
||||
stratplays,
|
||||
)
|
||||
|
||||
app = FastAPI(
|
||||
# root_path='/api',
|
||||
responses={404: {'description': 'Not found'}},
|
||||
docs_url='/api/docs',
|
||||
redoc_url='/api/redoc'
|
||||
responses={404: {"description": "Not found"}},
|
||||
docs_url="/api/docs",
|
||||
redoc_url="/api/redoc",
|
||||
)
|
||||
|
||||
# app.mount("/static", StaticFiles(directory="storage/static"), name="static")
|
||||
@ -53,10 +80,11 @@ app.include_router(decisions.router)
|
||||
|
||||
@app.get("/api/docs", include_in_schema=False)
|
||||
async def get_docs(req: Request):
|
||||
print(req.scope)
|
||||
return get_swagger_ui_html(openapi_url=req.scope.get('root_path')+'/openapi.json', title='Swagger')
|
||||
return get_swagger_ui_html(
|
||||
openapi_url=req.scope.get("root_path") + "/openapi.json", title="Swagger"
|
||||
)
|
||||
|
||||
|
||||
@app.get("/api/openapi.json", include_in_schema=False)
|
||||
async def openapi():
|
||||
return get_openapi(title='Paper Dynasty API', version=f'0.1.1', routes=app.routes)
|
||||
return get_openapi(title="Paper Dynasty API", version=f"0.1.1", routes=app.routes)
|
||||
|
||||
@ -150,7 +150,10 @@ async def get_teams(
|
||||
all_teams = all_teams.where(Team.has_guide == True)
|
||||
|
||||
if is_ai is not None:
|
||||
all_teams = all_teams.where(Team.is_ai)
|
||||
if not is_ai:
|
||||
all_teams = all_teams.where(Team.is_ai == False)
|
||||
else:
|
||||
all_teams = all_teams.where(Team.is_ai == True)
|
||||
|
||||
if event_id is not None:
|
||||
all_teams = all_teams.where(Team.event_id == event_id)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user