Compare commits
16 Commits
e30527a3c2
...
production
| Author | SHA1 | Date | |
|---|---|---|---|
| 867be98943 | |||
| d863d7f9e2 | |||
| dc60bb56a3 | |||
| 3ec0d04a56 | |||
|
|
f19d9658f0 | ||
|
|
a4e5966f54 | ||
|
|
928d92bd05 | ||
|
|
cd64877237 | ||
|
|
8a5880e5fa | ||
|
|
6431bcaa82 | ||
|
|
de7382846c | ||
|
|
6ecc8b22a5 | ||
|
|
e9d11223a7 | ||
|
|
72c2ca0aa9 | ||
|
|
cddb37ab91 | ||
|
|
d31a3cc822 |
@@ -17,7 +17,8 @@ steps:
|
|||||||
port: 22
|
port: 22
|
||||||
source: .
|
source: .
|
||||||
target: /home/app_fatura_homolog
|
target: /home/app_fatura_homolog
|
||||||
rm: true
|
rm: false
|
||||||
|
|
||||||
|
|
||||||
- name: restart homolog container
|
- name: restart homolog container
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
@@ -29,7 +30,7 @@ steps:
|
|||||||
script:
|
script:
|
||||||
- docker rm -f FaturasHomolog || true
|
- docker rm -f FaturasHomolog || true
|
||||||
- cd /home/app_fatura_homolog
|
- cd /home/app_fatura_homolog
|
||||||
- docker compose up -d
|
- docker compose -f docker-compose-homolog.yml up -d
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@@ -63,4 +64,3 @@ steps:
|
|||||||
- docker rm -f Faturas || true
|
- docker rm -f Faturas || true
|
||||||
- cd /home/app_fatura
|
- cd /home/app_fatura
|
||||||
- docker compose up -d
|
- docker compose up -d
|
||||||
|
|
||||||
|
|||||||
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
.env
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
.venv/
|
||||||
|
.vscode/
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
# trigger novo build Drone CI
|
# trigger novo build Drone CI
|
||||||
# teste de produção
|
# teste de produção
|
||||||
|
# novo teste
|
||||||
|
# novo teste
|
||||||
|
|||||||
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.
1
trigger.txt
Normal file
1
trigger.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# Trigger test Mon Jul 28 07:10:34 PM -03 2025
|
||||||
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.
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.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user