kjaymiller / cookiecutter-relecloud

Cookiecutter template for the Cloud Advocacy Relecloud Demo Application
MIT License
7 stars 5 forks source link

Adds check for incompatible combination #112

Closed kjaymiller closed 1 year ago

kjaymiller commented 1 year ago

With the addition of the Postgres-ACA-Extension (#110), we need to make sure that we're checking the future implementation for MongoDB we need to add some combination checks.

We can create a list of checks that require certain combinations in hooks/pre_generate_project.py

Reminder that pre-generate hooks unless they fail will not prevent the

# hooks/pre_generate_project.py

def valid_combinations() -> None:
    """Checks for valid combinations"""
    # Check if postgres-aca-addon ('postgres-server') was selected with ACA
    if {{cookiecutter.db_resource == "postgres-server"}} and not {{cookiecutter.project_host == "aca"}}:
        raise ValueError("Invalid Combination postgres-server must be selected with aca")
kjaymiller commented 1 year ago

added in #127