Ejemplo n.º 1
0
CONFIG_KEY = 'eip_worker'
TERRAFORM_BIN = './bin/terraform.exe'
TERRAFORM_DIR = './terraform/terraform_eip_worker'

ns = Collection('eip_worker')

ns_eip = aws_infrastructure.tasks.library.eip.create_tasks(
    config_key=CONFIG_KEY,
    terraform_bin=TERRAFORM_BIN,
    terraform_dir=TERRAFORM_DIR,
)

compose_collection(
    ns,
    ns_eip,
    sub=False,
    exclude=aws_infrastructure.tasks.library.terraform.exclude_without_state(
        terraform_dir=TERRAFORM_DIR,
        exclude=[
            'init',
            'output',
        ],
        exclude_without_state=[
            'destroy',
        ],
    ))

eip_read_only = aws_infrastructure.tasks.library.eip.create_eip_read_only(
    ns_eip=ns_eip)

ns = Collection("codebuild/web_patient")

ns_codebuild = aws_infrastructure.tasks.library.codebuild.create_tasks(
    config_key=CONFIG_KEY,
    terraform_bin=TERRAFORM_BIN,
    terraform_dir=TERRAFORM_DIR,
    staging_local_dir=STAGING_LOCAL_DIR,
    source_dir=SOURCE_DIR,
    codebuild_project_name=CODEBUILD_PROJECT_NAME,
    codebuild_environment_variables_factory=
    codebuild_environment_variables_factory,
)

compose_collection(
    ns,
    ns_codebuild,
    sub=False,
    exclude=aws_infrastructure.tasks.library.terraform.exclude_without_state(
        terraform_dir=TERRAFORM_DIR,
        exclude=[
            "init",
            "apply",
        ],
        exclude_without_state=[
            "destroy",
        ],
    ),
)
Ejemplo n.º 3
0
ns_minikube = aws_infrastructure.tasks.library.minikube.create_tasks(
    config_key=CONFIG_KEY,
    terraform_bin=TERRAFORM_BIN,
    terraform_dir=TERRAFORM_DIR,
    helm_repo_dir=HELM_REPO_DIR,
    staging_local_helmfile_dir=STAGING_LOCAL_HELMFILE_DIR,
    staging_remote_helm_dir=STAGING_REMOTE_HELM_DIR,
    staging_remote_helmfile_dir=STAGING_REMOTE_HELMFILE_DIR,
    instance_names=[INSTANCE_NAME],
    terraform_variables_factory=terraform_variables_factory,
    terraform_variables_path=TERRAFORM_VARIABLES_PATH,
)

compose_collection(
    ns,
    ns_minikube,
    sub=False,
    exclude=aws_infrastructure.tasks.library.terraform.exclude_without_state(
        terraform_dir=TERRAFORM_DIR,
        exclude=[
            'init',
            'helm-install',
            'helmfile-apply',
            'ssh-port-forward',
        ],
        exclude_without_state=[
            'destroy',
        ],
    ))
Ejemplo n.º 4
0
aws_infrastructure.tasks.library.color.enable_color()
# Apply the current AWS configuration
aws_infrastructure.tasks.library.aws_configure.apply_aws_env(
    aws_env_path=tasks.aws.AWS_ENV_PATH)

# Build our task collection
ns = Collection()

# Compose from aws.py
# compose_collection(ns, tasks.aws.ns, name="aws")

# Compose from codebuild
ns_codebuild = Collection("codebuild")

compose_collection(ns_codebuild,
                   tasks.codebuild.server_flask.ns,
                   name="server_flask")
compose_collection(ns_codebuild,
                   tasks.codebuild.web_patient.ns,
                   name="web_patient")
compose_collection(ns_codebuild,
                   tasks.codebuild.web_registry.ns,
                   name="web_registry")

compose_collection(ns, ns_codebuild, name="codebuild")

# Compose from database.py
compose_collection(ns, tasks.database.ns, name="database")

# Compose from documentdb.py
compose_collection(ns, tasks.documentdb.ns, name="documentdb")
Ejemplo n.º 5
0
from aws_infrastructure.tasks import compose_collection
import aws_infrastructure.tasks.library.aws_configure
from invoke import Collection

CONFIG_KEY = 'aws'
AWS_ENV_PATH = './secrets/aws/.aws_env'
AWS_CONFIGS = {
    'uwscope': aws_infrastructure.tasks.library.aws_configure.AWSConfig(
        aws_config_path='./secrets/aws/uwscope.config',
        profile='uwscope',
    )
}

ns = Collection('aws')

ns_configure = aws_infrastructure.tasks.library.aws_configure.create_tasks(
    config_key=CONFIG_KEY,
    aws_env_path=AWS_ENV_PATH,
    aws_configs=AWS_CONFIGS,
)

compose_collection(
    ns,
    ns_configure,
)
Ejemplo n.º 6
0
                                                             yarn_dirs=None),
    'celery':
    aws_infrastructure.tasks.library.dependencies.Dependency(pipfile_dirs=[
        './server_celery',
    ],
                                                             yarn_dirs=None),
    'flask':
    aws_infrastructure.tasks.library.dependencies.Dependency(pipfile_dirs=[
        './server_flask',
    ],
                                                             yarn_dirs=None),
    'root':
    aws_infrastructure.tasks.library.dependencies.Dependency(pipfile_dirs=[
        '.',
    ],
                                                             yarn_dirs=None),
}

ns = Collection('dependencies')

ns_dependencies = aws_infrastructure.tasks.library.dependencies.create_tasks(
    config_key=CONFIG_KEY,
    dependencies=DEPENDENCIES,
)

compose_collection(
    ns,
    ns_dependencies,
    sub=False,
)
Ejemplo n.º 7
0
"""
Tasks for managing Helm charts.
"""

from aws_infrastructure.tasks import compose_collection
import aws_infrastructure.tasks.library.helm
from invoke import Collection

CONFIG_KEY = 'helm'
HELM_BIN = './bin/helm.exe'
HELM_CHARTS_DIRS = [
    './helm',
]
HELM_REPO_DIR = './helm_repo'
STAGING_LOCAL_DIR = './.staging/helm_repo'

ns = Collection('helm')

ns_helm = aws_infrastructure.tasks.library.helm.create_tasks(
    config_key=CONFIG_KEY,
    helm_bin=HELM_BIN,
    helm_charts_dirs=HELM_CHARTS_DIRS,
    helm_repo_dir=HELM_REPO_DIR,
    staging_local_dir=STAGING_LOCAL_DIR,
)

compose_collection(ns, ns_helm, sub=False)
Ejemplo n.º 8
0

ns_documentdb = aws_infrastructure.tasks.library.documentdb.create_tasks(
    config_key=CONFIG_KEY,
    terraform_bin=TERRAFORM_BIN,
    terraform_dir=TERRAFORM_DIR,
    terraform_variables_factory=terraform_variables_factory,
    terraform_variables_path=TERRAFORM_VARIABLES_PATH,
    name=DOCUMENTDB_NAME,
)

compose_collection(
    ns,
    ns_documentdb,
    sub=False,
    exclude=aws_infrastructure.tasks.library.terraform.exclude_without_state(
        terraform_dir=TERRAFORM_DIR,
        exclude=[
            "destroy",  # Prevent destroy
            "init",
            "output",
        ],
        exclude_without_state=[
            "destroy",
        ],
    ),
)

documentdb_read_only = aws_infrastructure.tasks.library.documentdb.create_documentdb_read_only(
    ns_documentdb=ns_documentdb)