@catladder/pipeline
Version:
Panter workflow for cloud CI/CD and DevOps
25 lines • 1.77 kB
TypeScript
import { type StringOrBashExpression } from "../../../bash";
import type { ComponentContext } from "../../../types";
import type { DeployConfigCloudRun, DeployConfigCloudRunCloudSql } from "../../types";
export declare const getDatabaseDeleteScript: (context: ComponentContext, deployConfig: DeployConfigCloudRun) => string[];
export declare const getDatabaseCreateScript: (context: ComponentContext, deployConfig: DeployConfigCloudRun) => string[];
export type DBVariables = {
CLOUD_SQL_INSTANCE_CONNECTION_NAME: StringOrBashExpression;
DB_NAME: StringOrBashExpression;
DB_USER: StringOrBashExpression;
DB_PASSWORD: StringOrBashExpression;
};
/**
* controls how variables in the connection string are handled
*
* - legacy: variables like $DB_USER will be kept as environment variables to be replaced at runtime (default). It is not using BashExpressions as this was not the case in the past.
* - embedded: variables will be replaced with their actual values in the connection string
*
* We will remove the legacy mode in the future, as it is confusing. But its unclear whether its a breaking change in some edge cases
*/
export type DBVariablesMode = "legacy" | "embedded";
export declare const DEFAULT_DB_VARIABLES_MODE: DBVariablesMode;
export declare const getDatabaseJdbcUrl: (variables: DBVariables, mode: DBVariablesMode) => StringOrBashExpression;
export declare const getRailsDatabaseConnectionString: (variables: DBVariables, mode: DBVariablesMode) => StringOrBashExpression;
export declare const getPrismaDatabaseConnectionString: (variables: DBVariables, mode: DBVariablesMode) => StringOrBashExpression;
export declare const getDatabaseConnectionString: (config: DeployConfigCloudRunCloudSql, variables: DBVariables) => StringOrBashExpression;