Spaces:
Sleeping
Sleeping
Commit ·
557c4fb
1
Parent(s): c5affa0
Version 1.0.2
Browse files- .github/workflows/docker.yml +0 -38
- app/main.py +3 -3
- app/services/devops.py +4 -1
.github/workflows/docker.yml
DELETED
|
@@ -1,38 +0,0 @@
|
|
| 1 |
-
name: Docker Build (Backend)
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
push:
|
| 5 |
-
branches: [ main ]
|
| 6 |
-
tags: [ 'v*' ]
|
| 7 |
-
|
| 8 |
-
jobs:
|
| 9 |
-
build-and-push-backend:
|
| 10 |
-
runs-on: ubuntu-latest
|
| 11 |
-
steps:
|
| 12 |
-
- name: Checkout
|
| 13 |
-
uses: actions/checkout@v4
|
| 14 |
-
- name: Set up Docker Buildx
|
| 15 |
-
uses: docker/setup-buildx-action@v3
|
| 16 |
-
- name: Log in to Docker Hub
|
| 17 |
-
uses: docker/login-action@v3
|
| 18 |
-
with:
|
| 19 |
-
username: ${{ secrets.DOCKER_USERNAME }}
|
| 20 |
-
password: ${{ secrets.DOCKER_PASSWORD }}
|
| 21 |
-
- name: Extract metadata
|
| 22 |
-
id: meta
|
| 23 |
-
uses: docker/metadata-action@v5
|
| 24 |
-
with:
|
| 25 |
-
images: yourusername/deploymate-backend
|
| 26 |
-
tags: |
|
| 27 |
-
type=ref,event=branch
|
| 28 |
-
type=ref,event=pr
|
| 29 |
-
type=semver,pattern={{version}}
|
| 30 |
-
type=semver,pattern={{major}}.{{minor}}
|
| 31 |
-
- name: Build and push backend
|
| 32 |
-
uses: docker/build-push-action@v5
|
| 33 |
-
with:
|
| 34 |
-
context: ./backend
|
| 35 |
-
file: ./backend/Dockerfile
|
| 36 |
-
push: true
|
| 37 |
-
tags: ${{ steps.meta.outputs.tags }}
|
| 38 |
-
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/main.py
CHANGED
|
@@ -87,9 +87,9 @@ async def root():
|
|
| 87 |
# File download endpoint
|
| 88 |
@app.get("/download/{filename}")
|
| 89 |
async def download_file(
|
| 90 |
-
filename: str,
|
| 91 |
-
request: Request,
|
| 92 |
-
settings=Depends(get_settings),
|
| 93 |
logger=Depends(get_logger)
|
| 94 |
):
|
| 95 |
"""Download a generated file."""
|
|
|
|
| 87 |
# File download endpoint
|
| 88 |
@app.get("/download/{filename}")
|
| 89 |
async def download_file(
|
| 90 |
+
filename: str,
|
| 91 |
+
request: Request,
|
| 92 |
+
settings=Depends(get_settings),
|
| 93 |
logger=Depends(get_logger)
|
| 94 |
):
|
| 95 |
"""Download a generated file."""
|
app/services/devops.py
CHANGED
|
@@ -127,7 +127,10 @@ class DevOpsService:
|
|
| 127 |
# Render using Jinja2 Template directly
|
| 128 |
from jinja2 import Template
|
| 129 |
template = Template(template_content, trim_blocks=True, lstrip_blocks=True)
|
| 130 |
-
part = template.render(
|
|
|
|
|
|
|
|
|
|
| 131 |
if part.strip(): # Only add non-empty parts
|
| 132 |
script_parts.append(part)
|
| 133 |
except Exception as e:
|
|
|
|
| 127 |
# Render using Jinja2 Template directly
|
| 128 |
from jinja2 import Template
|
| 129 |
template = Template(template_content, trim_blocks=True, lstrip_blocks=True)
|
| 130 |
+
part = template.render(
|
| 131 |
+
config=config,
|
| 132 |
+
script_id=script_id
|
| 133 |
+
)
|
| 134 |
if part.strip(): # Only add non-empty parts
|
| 135 |
script_parts.append(part)
|
| 136 |
except Exception as e:
|