fixed deploy/run task issue

This commit is contained in:
Marvin Zhang
2019-03-02 09:37:55 +08:00
parent f3ff0a464a
commit 307a1872f1
10 changed files with 125 additions and 33 deletions

9
app.py
View File

@@ -1,8 +1,11 @@
import os
import shutil
from flask import Flask, logging
from flask_cors import CORS
from flask_restful import Api
from config import FLASK_HOST, FLASK_PORT
from config import FLASK_HOST, FLASK_PORT, PROJECT_LOGS_FOLDER
from routes.deploys import DeployApi
from routes.files import FileApi
from routes.nodes import NodeApi
@@ -45,5 +48,9 @@ api.add_resource(StatsApi,
'/api/stats',
'/api/stats/<string:action>')
# create folder if it does not exist
if os.path.exists(PROJECT_LOGS_FOLDER):
os.makedirs(PROJECT_LOGS_FOLDER)
if __name__ == '__main__':
app.run(host=FLASK_HOST, port=FLASK_PORT)