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