MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / write_profiles

Function write_profiles

test/canary-environment/mzcompose.py:148–165  ·  view source on GitHub ↗

Write the git-ignored profiles.toml pointing at the prod sandbox. The password is taken from $MATERIALIZE_PROD_SANDBOX_APP_PASSWORD at connect time via the `${VAR}` form. The default sslmode for a non-loopback host is `require`, which is what the cloud sandbox serves.

()

Source from the content-addressed store, hash-verified

146
147
148def write_profiles() -> None:
149 """Write the git-ignored profiles.toml pointing at the prod sandbox.
150
151 The password is taken from $MATERIALIZE_PROD_SANDBOX_APP_PASSWORD at
152 connect time via the `${VAR}` form. The default sslmode for a non-loopback
153 host is `require`, which is what the cloud sandbox serves.
154 """
155 assert MATERIALIZE_PROD_SANDBOX_HOSTNAME is not None
156 assert MATERIALIZE_PROD_SANDBOX_USERNAME is not None
157 assert loader.composition_path is not None
158 with open(loader.composition_path / "profiles.toml", "w") as f:
159 f.write(
160 "[prod]\n"
161 f'host = "{MATERIALIZE_PROD_SANDBOX_HOSTNAME}"\n'
162 "port = 6875\n"
163 f'username = "{MATERIALIZE_PROD_SANDBOX_USERNAME}"\n'
164 'password = "${MATERIALIZE_PROD_SANDBOX_APP_PASSWORD}"\n'
165 )
166
167
168def write_project_toml() -> None:

Callers 3

workflow_createFunction · 0.85
workflow_mz_deployFunction · 0.85
workflow_cleanFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected