hooks/post_gen_project.py
def copy_secrets(self):
        """Copy the Kubernetes secrets manifest."""
        secrets_template = ""
        environments = {
            "development": {
                "configuration": "Development",
                "debug": "True",
                "subdomain": "dev",
            },
            "integration": {
                "configuration": "Integration",
                "debug": "False",
                "subdomain": "test",
            },
            "production": {
                "configuration": "Production",
                "debug": "False",
                "subdomain": "www",
            },
        }
        secrets_template = Path("k8s/2_secrets.yaml.tpl").read_text()
        for environment, values in environments.items():
            secrets_text = (
                secrets_template.replace("__CONFIGURATION__", values["configuration"])
                .replace("__DEBUG__", values["debug"])
                .replace("__ENVIRONMENT__", environment)
                .replace("__SUBDOMAIN__", values["subdomain"])
                .replace("__SECRETKEY__", secrets.token_urlsafe(40))
                .replace("__PASSWORD__", secrets.token_urlsafe(8))
            )
            Path(f"k8s/{environment}/2_secrets.yaml").write_text(secrets_text)
Copy the Kubernetes secrets manifest.
Copy the Kubernetes secrets manifest.
Copy the Kubernetes secrets manifest .
def copy_secrets(self):
        secrets_template = ""
        environments = {
            "development": {
                "configuration": "Development",
                "debug": "True",
                "subdomain": "dev",
            },
            "integration": {
                "configuration": "Integration",
                "debug": "False",
                "subdomain": "test",
            },
            "production": {
                "configuration": "Production",
                "debug": "False",
                "subdomain": "www",
            },
        }
        secrets_template = Path("k8s/2_secrets.yaml.tpl").read_text()
        for environment, values in environments.items():
            secrets_text = (
                secrets_template.replace("__CONFIGURATION__", values["configuration"])
                .replace("__DEBUG__", values["debug"])
                .replace("__ENVIRONMENT__", environment)
                .replace("__SUBDOMAIN__", values["subdomain"])
                .replace("__SECRETKEY__", secrets.token_urlsafe(40))
                .replace("__PASSWORD__", secrets.token_urlsafe(8))
            )
            Path(f"k8s/{environment}/2_secrets.yaml").write_text(secrets_text)
def copy_secrets ( self ) : secrets_template = "" environments = { "development" : { "configuration" : "Development" , "debug" : "True" , "subdomain" : "dev" , } , "integration" : { "configuration" : "Integration" , "debug" : "False" , "subdomain" : "test" , } , "production" : { "configuration" : "Production" , "debug" : "False" , "subdomain" : "www" , } , } secrets_template = Path ( "k8s/2_secrets.yaml.tpl" ) . read_text ( ) for environment , values in environments . items ( ) : secrets_text = ( secrets_template . replace ( "__CONFIGURATION__" , values [ "configuration" ] ) . replace ( "__DEBUG__" , values [ "debug" ] ) . replace ( "__ENVIRONMENT__" , environment ) . replace ( "__SUBDOMAIN__" , values [ "subdomain" ] ) . replace ( "__SECRETKEY__" , secrets . token_urlsafe ( 40 ) ) . replace ( "__PASSWORD__" , secrets . token_urlsafe ( 8 ) ) ) Path ( f"k8s/{environment}/2_secrets.yaml" ) . write_text ( secrets_text )
Copy the Kubernetes secrets manifest.
Copy the Kubernetes secrets manifest .
"""Copy the Kubernetes secrets manifest."""
self