mirror of
https://github.com/karma-riuk/crab-webapp.git
synced 2025-07-04 22:08:12 +02:00
added dotenv and using to know if we need to
return mock build handler
This commit is contained in:
@ -5,3 +5,4 @@ docker
|
|||||||
javalang
|
javalang
|
||||||
bs4
|
bs4
|
||||||
sacrebleu
|
sacrebleu
|
||||||
|
python-dotenv
|
||||||
|
@ -8,6 +8,10 @@ from routes.datasets import router as datasets_router
|
|||||||
from werkzeug.exceptions import HTTPException
|
from werkzeug.exceptions import HTTPException
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
app = Flask(__name__, static_folder='../public', static_url_path='/')
|
app = Flask(__name__, static_folder='../public', static_url_path='/')
|
||||||
CORS(app)
|
CORS(app)
|
||||||
|
|
||||||
|
@ -633,7 +633,8 @@ def get_build_handler(root: str, repo: str, verbose: bool = False) -> BuildHandl
|
|||||||
an instance of GradleHandler or MavenHandler
|
an instance of GradleHandler or MavenHandler
|
||||||
"""
|
"""
|
||||||
path = os.path.join(root, repo)
|
path = os.path.join(root, repo)
|
||||||
return WaitBuildHander("NO REPO PATH", "NO BUILD FILE", {})
|
if os.getenv('MOCK_BUILD_HANDLER', False):
|
||||||
|
return WaitBuildHander("NO REPO PATH", "NO BUILD FILE", {})
|
||||||
|
|
||||||
# 1) If it's a tarball, extract it
|
# 1) If it's a tarball, extract it
|
||||||
if os.path.isfile(path) and tarfile.is_tarfile(path):
|
if os.path.isfile(path) and tarfile.is_tarfile(path):
|
||||||
|
Reference in New Issue
Block a user