Include git hash in env variables for functions
This commit is contained in:
@@ -8,6 +8,7 @@ from typing import Optional
|
||||
s3_client = None
|
||||
bucket_config = ''
|
||||
bucket_data = ''
|
||||
git_version = ''
|
||||
|
||||
class RequestParams(BaseModel):
|
||||
id: str
|
||||
@@ -20,14 +21,18 @@ class Content(BaseModel):
|
||||
url: Optional[str] = None
|
||||
|
||||
def lambda_handler(event: dict, context):
|
||||
global s3_client, bucket_config, bucket_data
|
||||
global s3_client, bucket_config, bucket_data, git_version
|
||||
|
||||
if s3_client is None:
|
||||
print("Init Function")
|
||||
bucket_config = os.environ.get('BUCKET_CONFIG', 'standout-config')
|
||||
bucket_data = os.environ.get('BUCKET_DATA', 'standout-data')
|
||||
print(f'Bucket Config: {bucket_config}')
|
||||
git_version = os.environ.get('GIT_VERSION', '00000000')
|
||||
|
||||
print(f' Version: {git_version}')
|
||||
print(f' Bucket Data: {bucket_data}')
|
||||
print(f'Bucket Config: {bucket_config}')
|
||||
|
||||
s3_client = boto3.client('s3')
|
||||
|
||||
## Download redirects file
|
||||
|
||||
Reference in New Issue
Block a user