renovate/lib/manager/terragrunt/util.ts
renovate[bot] 6c414e7736
chore(deps): update dependency eslint-config-prettier to v7 (#7940)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2020-12-11 09:35:56 +01:00

52 lines
1.2 KiB
TypeScript

import { PackageDependency } from '../common';
export const keyValueExtractionRegex = /^\s*source\s+=\s+"(?<value>[^"]+)"\s*$/;
export interface ExtractionResult {
lineNumber: number;
dependencies: PackageDependency[];
}
export enum TerragruntDependencyTypes {
unknown = 'unknown',
terragrunt = 'terraform',
}
export interface TerraformManagerData {
terragruntDependencyType: TerragruntDependencyTypes;
}
export enum TerragruntResourceTypes {
unknown = 'unknown',
/**
* https://www.terraform.io/docs/providers/docker/r/container.html
*/
}
export interface ResourceManagerData extends TerraformManagerData {
resourceType?: TerragruntResourceTypes;
chart?: string;
image?: string;
name?: string;
repository?: string;
}
export function getTerragruntDependencyType(
value: string
): TerragruntDependencyTypes {
switch (value) {
case 'terraform': {
return TerragruntDependencyTypes.terragrunt;
}
default: {
return TerragruntDependencyTypes.unknown;
}
}
}
export function checkFileContainsDependency(
content: string,
checkList: string[]
): boolean {
return checkList.some((check) => content.includes(check));
}