Skip to content

Commit

Permalink
V2 dev pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sureshhewabi committed Aug 5, 2024
1 parent cf1e14f commit d59e8b7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/github-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
DB_PASSWORD : ${{ secrets.DB_PASSWORD }}
DB_PORT : ${{ vars.DB_PORT }}
API_KEY : ${{ secrets.API_KEY }}
API_VERSION : ${{ vars.API_KEY }}
PORT: ${{ vars.PORT }}
node_port: ${{ vars.NODE_PORT }}
app_name: ${{ vars.APP_NAME }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
DB_PASSWORD : ${{ secrets.DB_PASSWORD }}
DB_PORT : ${{ vars.DB_PORT }}
API_KEY : ${{ secrets.API_KEY }}
API_VERSION : ${{ vars.API_KEY }}
PORT: ${{ vars.PORT }}
node_port: ${{ vars.NODE_PORT }}
app_name: ${{ vars.APP_NAME }}
Expand Down
3 changes: 2 additions & 1 deletion app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
from app.routes.xiview import xiview_data_router
from app.routes.parse import parser_router
from fastapi.middleware.gzip import GZipMiddleware
from db_config_parser import API_version

# Initialize logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
API_VERSION = "v2"
API_VERSION = API_version()

app = FastAPI(title="xi-mzidentml-converter ws",
description="This is an API to crosslinking archive",
Expand Down
7 changes: 7 additions & 0 deletions db_config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ def security_API_key():
return apikey


def API_version():
config = os.environ.get('DB_CONFIG', 'database.ini')
security_info = parse_info(config, 'security')
apiversion = security_info.get("apiversion")
return apiversion


def redis_config():
config = os.environ.get('DB_CONFIG', 'database.ini')
redis_info = parse_info(config, 'redis')
Expand Down

0 comments on commit d59e8b7

Please sign in to comment.