Skip to content

Commit

Permalink
Merge remote changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhrumilp12 committed May 6, 2024
1 parent 3f129b3 commit 09603c9
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@

import os
from dotenv import load_dotenv

# Check if running in GitHub Actions environment
if os.getenv('GITHUB_ACTIONS'):
# Load environment variables directly from GitHub Actions secrets
HOST = os.getenv('HOST')
MASTER_KEY = os.getenv('MASTER_KEY')
DATABASE_ID = os.getenv('DATABASE_ID')
CONTAINER_ID = os.getenv('CONTAINER_ID')
else:
# Load environment variables from .env file using dotenv
from dotenv import load_dotenv
load_dotenv()
HOST = os.getenv('HOST')
MASTER_KEY = os.getenv('MASTER_KEY')
DATABASE_ID = os.getenv('DATABASE_ID')
CONTAINER_ID = os.getenv('CONTAINER_ID')
# Load environment variables from .env file
load_dotenv()

# Check if any of the required environment variables are missing
if not all([HOST, MASTER_KEY, DATABASE_ID, CONTAINER_ID]):
print("Error: Please make sure HOST, MASTER_KEY, DATABASE_ID, and CONTAINER_ID environment variables are set.")
exit(1)
settings = {
'host': os.environ.get('ACCOUNT_HOST'),
'master_key': os.environ.get('ACCOUNT_KEY'),
'database_id': os.environ.get('COSMOS_DATABASE'),
'container_id': os.environ.get('COSMOS_CONTAINER'),
}

0 comments on commit 09603c9

Please sign in to comment.