Compare commits
18 Commits
1.1.2
...
921a784fc0
Author | SHA1 | Date | |
---|---|---|---|
921a784fc0
|
|||
43678c69fb
|
|||
4577f8f0a5
|
|||
4dd3e9e799
|
|||
46ce0e1d54
|
|||
07b5a2a512
|
|||
d30abf3d0c
|
|||
f8061aaa7a
|
|||
e1cce96308
|
|||
3bd9882beb
|
|||
6004f6aeb4
|
|||
3ffcf262e5
|
|||
550b5ff28a
|
|||
302f4df307
|
|||
b8f4a3c46f
|
|||
1cee3b5dae
|
|||
0d28c61c0f
|
|||
7fefc75d64
|
@@ -97,11 +97,30 @@ build-windows-binary:
|
||||
- python3.13
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
artifacts:
|
||||
paths:
|
||||
- sbom-dt-dd.exe
|
||||
script:
|
||||
- 'C:\Program Files\Python313\python.exe' -m venv venv
|
||||
- .\venv\Scripts\pip.exe install --upgrade pip
|
||||
- .\venv\Scripts\pip.exe install -r requirements.txt
|
||||
- .\venv\Scripts\pip.exe install pyinstaller
|
||||
- .\venv\Scripts\pyinstaller.exe --onefile sbom-dt-dd.py
|
||||
- |
|
||||
cd src
|
||||
mv ..\dependencytrack-client .
|
||||
mv ..\defectdojo-client .
|
||||
& 'C:\Program Files\Python313\python.exe' -m venv venv
|
||||
.\venv\Scripts\pip.exe install --upgrade pip
|
||||
.\venv\Scripts\pip.exe install -r requirements.txt
|
||||
.\venv\Scripts\pip.exe install -r dependencytrack-client\requirements.txt
|
||||
.\venv\Scripts\pip.exe install -r defectdojo-client\requirements.txt
|
||||
.\venv\Scripts\pip.exe install pyinstaller
|
||||
.\venv\Scripts\pyinstaller.exe --onefile `
|
||||
--add-data "dependencytrack-client;dependencytrack-client" `
|
||||
--add-data "defectdojo-client;defectdojo-client" `
|
||||
--hidden-import pydantic `
|
||||
--hidden-import dateutil.parser `
|
||||
--hidden-import urllib3 `
|
||||
--hidden-import regex `
|
||||
--collect-data cyclonedx `
|
||||
--collect-data license_experssion `
|
||||
sbom-dt-dd.py
|
||||
mv dist\sbom-dt-dd.exe ..
|
||||
|
||||
|
||||
|
33
snippets/websrv/main.py
Normal file
33
snippets/websrv/main.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
app = FastAPI(
|
||||
title="My FastAPI App",
|
||||
version="1.0.0",
|
||||
description="A simple FastAPI example with uvicorn and gunicorn."
|
||||
)
|
||||
|
||||
@app.get("/hello")
|
||||
async def say_hello(name: str):
|
||||
"""
|
||||
Returns a friendly greeting.
|
||||
---
|
||||
parameters:
|
||||
- name: name
|
||||
in: query
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
description: Successful Response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
"""
|
||||
return JSONResponse(content={"message": f"Hello, {name}!"})
|
||||
|
3
snippets/websrv/requirements.txt
Normal file
3
snippets/websrv/requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
fastapi==0.116.1
|
||||
gunicorn==23.0.0
|
||||
uvicorn==0.35.0
|
4
snippets/websrv/server.sh
Executable file
4
snippets/websrv/server.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
./.venv/bin/gunicorn main:app -k uvicorn.workers.UvicornWorker -w 4 -b 0.0.0.0:8000
|
||||
|
@@ -4,11 +4,15 @@ import argparse
|
||||
import subprocess
|
||||
import json
|
||||
|
||||
import defectdojo_api
|
||||
from defectdojo_api.rest import ApiException as DefectDojoApiException
|
||||
import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'defectdojo-client'))
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'dependencytrack-client'))
|
||||
|
||||
import defectdojo_api
|
||||
from defectdojo_api.rest import ApiException as DefectDojoApiException
|
||||
|
||||
import dependencytrack_api
|
||||
from dependencytrack_api.rest import ApiException as DependencyTrackApiException
|
||||
|
||||
|
Reference in New Issue
Block a user