Compare commits
3 Commits
f19d9658f0
...
d863d7f9e2
| Author | SHA1 | Date | |
|---|---|---|---|
| d863d7f9e2 | |||
| dc60bb56a3 | |||
| 3ec0d04a56 |
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
.env
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
.venv/
|
||||||
|
.vscode/
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,15 +1,18 @@
|
|||||||
from sqlalchemy import create_engine
|
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
|
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
|
||||||
from sqlalchemy.orm import sessionmaker, declarative_base
|
from sqlalchemy.orm import sessionmaker, declarative_base
|
||||||
from contextlib import contextmanager
|
from contextlib import asynccontextmanager
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
import os
|
||||||
|
|
||||||
# database.py
|
load_dotenv()
|
||||||
DATABASE_URL = "postgresql+asyncpg://fatura:102030@ic-postgresql-FtOY:5432/producao"
|
|
||||||
|
DATABASE_URL = os.getenv("DATABASE_URL")
|
||||||
|
|
||||||
async_engine = create_async_engine(DATABASE_URL, echo=False, future=True)
|
async_engine = create_async_engine(DATABASE_URL, echo=False, future=True)
|
||||||
AsyncSessionLocal = sessionmaker(bind=async_engine, class_=AsyncSession, expire_on_commit=False)
|
AsyncSessionLocal = sessionmaker(bind=async_engine, class_=AsyncSession, expire_on_commit=False)
|
||||||
Base = declarative_base()
|
Base = declarative_base()
|
||||||
|
|
||||||
|
@asynccontextmanager
|
||||||
async def get_session():
|
async def get_session():
|
||||||
async with AsyncSessionLocal() as session:
|
async with AsyncSessionLocal() as session:
|
||||||
yield session
|
yield session
|
||||||
4
app/git-commit.ps1
Normal file
4
app/git-commit.ps1
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
$message = Read-Host "Digite a descrição do commit"
|
||||||
|
git add .
|
||||||
|
git commit -m "$message"
|
||||||
|
git push origin main
|
||||||
4
deploy-homolog.ps1
Normal file
4
deploy-homolog.ps1
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
$message = Read-Host "Digite a descrição do commit para homologação"
|
||||||
|
git add .
|
||||||
|
git commit -m "$message"
|
||||||
|
git push origin main
|
||||||
18
deploy-prod.ps1
Normal file
18
deploy-prod.ps1
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
$message = Read-Host "Digite a descrição do commit para produção"
|
||||||
|
|
||||||
|
Write-Host "→ Mudando para a branch 'production'..."
|
||||||
|
git checkout production
|
||||||
|
|
||||||
|
Write-Host "→ Mesclando alterações da branch 'main'..."
|
||||||
|
git merge main
|
||||||
|
|
||||||
|
Write-Host "→ Commitando descrição interativa..."
|
||||||
|
git commit --allow-empty -m "$message"
|
||||||
|
|
||||||
|
Write-Host "→ Enviando para o repositório remoto..."
|
||||||
|
git push origin production
|
||||||
|
|
||||||
|
Write-Host "→ Voltando para a branch 'main'..."
|
||||||
|
git checkout main
|
||||||
|
|
||||||
|
Write-Host "✅ Deploy para produção finalizado!"
|
||||||
Binary file not shown.
Reference in New Issue
Block a user