Compare commits
No commits in common. "f86396107db1baaf234c613cf7e561f90b15de65" and "154aadb6b76ba8866cb145b0b29601da3442c87c" have entirely different histories.
f86396107d
...
154aadb6b7
@ -3,7 +3,7 @@ steps:
|
||||
name: Build & Push Frontend
|
||||
image: woodpeckerci/plugin-kaniko
|
||||
when:
|
||||
branch: [ master, develop, aws ]
|
||||
branch: [ master, develop ]
|
||||
event: [ push, pull_request, tag ]
|
||||
path:
|
||||
include: [ frontend/** ]
|
||||
@ -24,7 +24,7 @@ steps:
|
||||
name: Build & Push Backend
|
||||
image: woodpeckerci/plugin-kaniko
|
||||
when:
|
||||
branch: [ master, develop, aws ]
|
||||
branch: [ master, develop ]
|
||||
event: [ push, pull_request, tag ]
|
||||
path:
|
||||
include: [ backend/** ]
|
||||
|
||||
@ -101,10 +101,8 @@ def upload_to_r2(file_path):
|
||||
endpoint_url=R2_ENDPOINT,
|
||||
aws_access_key_id=R2_ACCESS_KEY,
|
||||
aws_secret_access_key=R2_SECRET_KEY,
|
||||
config=Config(
|
||||
signature_version='s3v4',
|
||||
s3={'addressing_style': 'path'}
|
||||
)
|
||||
config=Config(signature_version='s3v4'),
|
||||
region_name='auto'
|
||||
)
|
||||
|
||||
# Upload file
|
||||
@ -136,10 +134,8 @@ def list_r2_backups():
|
||||
endpoint_url=R2_ENDPOINT,
|
||||
aws_access_key_id=R2_ACCESS_KEY,
|
||||
aws_secret_access_key=R2_SECRET_KEY,
|
||||
config=Config(
|
||||
signature_version='s3v4',
|
||||
s3={'addressing_style': 'path'}
|
||||
)
|
||||
config=Config(signature_version='s3v4'),
|
||||
region_name='auto'
|
||||
)
|
||||
|
||||
try:
|
||||
|
||||
@ -9,7 +9,6 @@ import shutil
|
||||
from datetime import datetime
|
||||
from typing import List
|
||||
import boto3
|
||||
from botocore.config import Config
|
||||
from botocore.exceptions import ClientError
|
||||
from dotenv import load_dotenv
|
||||
|
||||
@ -50,10 +49,7 @@ def get_r2_client():
|
||||
endpoint_url=os.getenv('R2_ENDPOINT'),
|
||||
aws_access_key_id=os.getenv('R2_ACCESS_KEY'),
|
||||
aws_secret_access_key=os.getenv('R2_SECRET_KEY'),
|
||||
config=Config(
|
||||
signature_version='s3v4',
|
||||
s3={'addressing_style': 'path'}
|
||||
)
|
||||
region_name='auto'
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -81,9 +81,9 @@ def update_recipe_db(recipe_id: int, recipe_data: Dict[str, Any]) -> Optional[Di
|
||||
SET name = %s,
|
||||
meal_type = %s,
|
||||
time_minutes = %s,
|
||||
tags = %s::text[],
|
||||
ingredients = %s::text[],
|
||||
steps = %s::text[],
|
||||
tags = %s,
|
||||
ingredients = %s,
|
||||
steps = %s,
|
||||
image = %s,
|
||||
made_by = %s
|
||||
WHERE id = %s
|
||||
@ -93,9 +93,9 @@ def update_recipe_db(recipe_id: int, recipe_data: Dict[str, Any]) -> Optional[Di
|
||||
recipe_data["name"],
|
||||
recipe_data["meal_type"],
|
||||
recipe_data["time_minutes"],
|
||||
recipe_data.get("tags", []),
|
||||
recipe_data.get("ingredients", []),
|
||||
recipe_data.get("steps", []),
|
||||
json.dumps(recipe_data.get("tags", [])),
|
||||
json.dumps(recipe_data.get("ingredients", [])),
|
||||
json.dumps(recipe_data.get("steps", [])),
|
||||
recipe_data.get("image"),
|
||||
recipe_data.get("made_by"),
|
||||
recipe_id,
|
||||
@ -136,16 +136,16 @@ def create_recipe_db(recipe_data: Dict[str, Any]) -> Dict[str, Any]:
|
||||
cur.execute(
|
||||
"""
|
||||
INSERT INTO recipes (name, meal_type, time_minutes, tags, ingredients, steps, image, made_by, user_id)
|
||||
VALUES (%s, %s, %s, %s::text[], %s::text[], %s::text[], %s, %s, %s)
|
||||
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)
|
||||
RETURNING id, name, meal_type, time_minutes, tags, ingredients, steps, image, made_by, user_id
|
||||
""",
|
||||
(
|
||||
recipe_data["name"],
|
||||
recipe_data["meal_type"],
|
||||
recipe_data["time_minutes"],
|
||||
recipe_data.get("tags", []),
|
||||
recipe_data.get("ingredients", []),
|
||||
recipe_data.get("steps", []),
|
||||
json.dumps(recipe_data.get("tags", [])),
|
||||
json.dumps(recipe_data.get("ingredients", [])),
|
||||
json.dumps(recipe_data.get("steps", [])),
|
||||
recipe_data.get("image"),
|
||||
recipe_data.get("made_by"),
|
||||
recipe_data.get("user_id"),
|
||||
@ -189,4 +189,3 @@ def get_recipes_by_filters_db(
|
||||
return rows
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
@ -38,10 +38,8 @@ def list_r2_backups():
|
||||
endpoint_url=R2_ENDPOINT,
|
||||
aws_access_key_id=R2_ACCESS_KEY,
|
||||
aws_secret_access_key=R2_SECRET_KEY,
|
||||
config=Config(
|
||||
signature_version='s3v4',
|
||||
s3={'addressing_style': 'path'}
|
||||
)
|
||||
config=Config(signature_version='s3v4'),
|
||||
region_name='auto'
|
||||
)
|
||||
|
||||
try:
|
||||
@ -69,10 +67,8 @@ def download_from_r2(backup_name):
|
||||
endpoint_url=R2_ENDPOINT,
|
||||
aws_access_key_id=R2_ACCESS_KEY,
|
||||
aws_secret_access_key=R2_SECRET_KEY,
|
||||
config=Config(
|
||||
signature_version='s3v4',
|
||||
s3={'addressing_style': 'path'}
|
||||
)
|
||||
config=Config(signature_version='s3v4'),
|
||||
region_name='auto'
|
||||
)
|
||||
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user