diff --git a/matching/config/config.py b/matching/config/config.py index 624f9d6..16f5cf5 100644 --- a/matching/config/config.py +++ b/matching/config/config.py @@ -30,6 +30,26 @@ def __init__(self): ) +class SandboxConfig(Config): + def __init__(self): + super().__init__() + os.environ['FLASK_ENV'] = 'production' + + DEBUG = False + + POSTGRES_USER = os.getenv('POSTGRES_USER','brighthive') + POSTGRES_PASSWORD = os.getenv('POSTGRES_PASSWORD', 'test_password') + POSTGRES_DATABASE = os.getenv('POSTGRES_DATABASE','mci_dev') + POSTGRES_PORT = os.getenv('POSTGRES_PORT', 5432) + POSTGRES_HOSTNAME = os.getenv('POSTGRES_HOSTNAME','localhost') + SQLALCHEMY_DATABASE_URI = 'postgresql://{}:{}@{}:{}/{}'.format( + POSTGRES_USER, + POSTGRES_PASSWORD, + POSTGRES_HOSTNAME, + POSTGRES_PORT, + POSTGRES_DATABASE + ) + class TestConfig(Config): def __init__(self): super().__init__() @@ -95,6 +115,8 @@ def get_config(config_type: str): return TestConfig() elif config_type.upper() == 'DEVELOPMENT': return DevelopmentConfig() + elif config_type.upper() == 'SANDBOX': + return SandboxConfig() elif config_type.upper() == 'PRODUCTION': return ProductionConfig() diff --git a/scripts/ecr_build.sh b/scripts/ecr_build.sh new file mode 100755 index 0000000..e436493 --- /dev/null +++ b/scripts/ecr_build.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# ---------------------------------------------------------------------------- +# ecr_build.sh - Build the image and push it to Docker +# +# ---------------------------------------------------------------------------- + +CONTAINER_VERSION=1.0.0 +CONTAINER_NAME=brighthive/mci-matching-service +ECR_BASE=396527728813.dkr.ecr.us-east-2.amazonaws.com + +# Build the Container +docker build -t $CONTAINER_NAME:$CONTAINER_VERSION . +docker tag $CONTAINER_NAME:$CONTAINER_VERSION $CONTAINER_NAME:latest + +# Tag the Containers +docker tag $CONTAINER_NAME:$CONTAINER_VERSION $ECR_BASE/$CONTAINER_NAME:$CONTAINER_VERSION +docker tag $CONTAINER_NAME:latest $ECR_BASE/$CONTAINER_NAME:latest + +# Login to ECR +$(aws ecr get-login --no-include-email --region us-east-2) + +# Push to ECR +docker push $ECR_BASE/$CONTAINER_NAME:$CONTAINER_VERSION +docker push $ECR_BASE/$CONTAINER_NAME:latest \ No newline at end of file