Skip to content

Commit

Permalink
Merge pull request #11 from brighthive/add-sandbox-config
Browse files Browse the repository at this point in the history
Add sandbox config
  • Loading branch information
gregmundy authored Sep 5, 2020
2 parents 986d22c + 6992eda commit 3ec073d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
22 changes: 22 additions & 0 deletions matching/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__()
Expand Down Expand Up @@ -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()

Expand Down
25 changes: 25 additions & 0 deletions scripts/ecr_build.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3ec073d

Please sign in to comment.