UNPKG

@deploystack/docker-to-iac

Version:

Translate docker run and docker compose file to Infrastructure as Code

45 lines (44 loc) 2.13 kB
/** * Assertions for validating DigitalOcean App Platform YAML output */ /** * Asserts that the DigitalOcean YAML has the correct structure * @param doYaml The parsed DigitalOcean YAML template * @throws Error if the validation fails */ export declare function assertDigitalOceanYamlStructure(doYaml: any): void; /** * Validates that the environment variables in the DigitalOcean YAML match expected values * @param doYaml The parsed DigitalOcean YAML template * @param serviceName Name of the service to check * @param expectedEnvVars The expected environment variables * @returns true if validation passes, false otherwise */ export declare function validateEnvironmentVariables(doYaml: any, serviceName: string, expectedEnvVars: Record<string, string>): boolean; /** * Validates that the service has port configuration * @param doYaml The parsed DigitalOcean YAML template * @param serviceName Name of the service to check * @param expectedPort The expected port number * @returns true if validation passes, false otherwise */ export declare function validatePortMapping(doYaml: any, serviceName: string, expectedPort: number): boolean; /** * Validates that the volume mount exists in the service * Note: DigitalOcean App Platform has limited volume support compared to Render * This function checks for the presence of expected environment variables that * would typically be used as mount points * * @param doYaml The parsed DigitalOcean YAML template * @param serviceName Name of the service to check * @param mountPath Path that would be mounted * @returns true if environment variables exist that suggest volume access, false otherwise */ export declare function validateVolumeMounting(doYaml: any, serviceName: string, mountPath: string): boolean; /** * Validates that a database service exists * @param doYaml The parsed DigitalOcean YAML template * @param dbType The expected database type (PG, MYSQL, REDIS, etc.) * @returns true if a database with the matching type exists, false otherwise */ export declare function validateDatabaseService(doYaml: any, dbType: string): boolean;