Skip to content

Commit 0eb6ecb

Browse files
committed
feat: add resources
Signed-off-by: Vikram Vaswani <2571660+vvaswani@users.noreply.github.com>
0 parents  commit 0eb6ecb

14 files changed

Lines changed: 4501 additions & 0 deletions

.github/workflows/release.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: release
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
env:
13+
IMAGE_NAME: demo-app
14+
IMAGE_TAG: ${{ github.sha }}
15+
REGISTRY: ttl.sh
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Build Docker image
22+
run: |
23+
docker build -t ${REGISTRY}/${IMAGE_NAME}-${IMAGE_TAG}:1h ./app
24+
25+
- name: Push to ttl.sh
26+
id: push_image
27+
run: |
28+
docker push ${REGISTRY}/${IMAGE_NAME}-${IMAGE_TAG}:1h
29+
30+
- name: Show pushed image name
31+
if: ${{ steps.push_image.outcome == 'success' }}
32+
run: echo "Image available at ${REGISTRY}/${IMAGE_NAME}-${IMAGE_TAG}:1h"

app/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__pycache__/
2+
*.pyc
3+
.git

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.venv

app/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
COPY ./requirements.txt /app/requirements.txt
6+
7+
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
8+
9+
COPY . /app
10+
11+
CMD ["fastapi", "run", "main.py", "--port", "80"]

app/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from fastapi import FastAPI
2+
3+
app = FastAPI()
4+
5+
6+
@app.get("/")
7+
async def root():
8+
return {"message": "Hello World"}

app/requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
anyio==3.7.1
2+
fastapi==0.70.0
3+
idna==3.11
4+
pydantic==1.10.24
5+
sniffio==1.3.1
6+
starlette==0.16.0
7+
typing_extensions==4.15.0
8+

data/demo-project-1-0.96.9.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

data/demo-project-1-0.96.9.sarif

Lines changed: 1745 additions & 0 deletions
Large diffs are not rendered by default.

data/demo-project-1-1.73.1.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

data/demo-project-1-1.73.1.sarif

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "2.1.0",
3+
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/main/sarif-2.1/schema/sarif-schema-2.1.0.json",
4+
"runs": [
5+
{
6+
"tool": {
7+
"driver": {
8+
"fullName": "Trivy Vulnerability Scanner",
9+
"informationUri": "https://github.com/aquasecurity/trivy",
10+
"name": "Trivy",
11+
"rules": [],
12+
"version": "0.67.2"
13+
}
14+
},
15+
"results": [],
16+
"columnKind": "utf16CodeUnits",
17+
"originalUriBaseIds": {
18+
"ROOTPATH": {
19+
"uri": "file:///"
20+
}
21+
}
22+
}
23+
]
24+
}

0 commit comments

Comments
 (0)