@cdklib/argo-synth
Version:
Manage ArgoCD structure with cdk8s
1 lines • 18.2 kB
Source Map (JSON)
{"version":3,"sources":["../src/paths.ts","../src/helm/chart.ts","../src/synth/fs.ts","../src/synth/api-object.ts","../src/synth/helm-chart.ts","../src/synth/synth.ts","../src/index.ts"],"names":["path","Chart","promisify","exec","mkdir","s","ApiObject","outputPath","writeFile","Yaml"],"mappings":";;;;;;;;;;;;;AAGA,IAAM,cAAiB,GAAA,0BAAA;AAOhB,IAAM,YAAA,GAAe,CAAC,KAAA,EAAA,GAAqB,QAAuB,KAAA;AACrE,EAAA,IAAI,WAAsB,GAAA,EAAA;AAC1B,EAAI,IAAA;AACA,IAAA,WAAA,GAAc,aAAa,KAAK,CAAA;AAAA,GAC5B,CAAA,MAAA;AAAA;AAIR,EAAA,MAAM,QAAW,GAAA,WAAA,GAAc,CAAC,WAAW,IAAI,EAAC;AAEhD,EAAM,KAAA,CAAA,IAAA,CAAK,WAAW,cAAgB,EAAAA,sBAAA,CAAK,KAAK,GAAG,QAAA,EAAU,GAAG,QAAQ,CAAC,CAAA;AAC7E,CAAA;AAOO,IAAM,YAAA,GAAe,CAAC,KAA6B,KAAA;AACtD,EAAI,IAAA;AACA,IAAO,OAAA,KAAA,CAAM,IAAK,CAAA,UAAA,CAAW,cAAc,CAAA;AAAA,WACtC,CAAG,EAAA;AACR,IAAA,IAAI,aAAa,KAAS,IAAA,CAAA,CAAE,OAAQ,CAAA,QAAA,CAAS,kBAAkB,CAAG,EAAA;AAC9D,MAAM,MAAA,IAAI,MAAM,+CAA+C,CAAA;AAAA;AAEnE,IAAM,MAAA,CAAA;AAAA;AAEd,CAAA;ACHa,IAAA,eAAA,GAAN,cAA8BC,WAAM,CAAA;AAAA,EAC9B,IAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EAET,WAAA,CACI,OACA,EAAE,IAAA,EAAM,QAAQ,SAAW,EAAA,OAAA,EAAS,YACtC,EAAA;AACE,IAAM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ER,CAAA;AASO,IAAM,SAAA,GAAY,OACrB,UAAA,EACA,IACA,EAAA,EAAE,KAAQ,GAAA,KAAA,EAAO,OAAU,GAAA,IAAA,EAAuB,GAAA,EACjD,KAAA;AACD,EAAI,IAAA,KAAA,EAAa,MAAA,aAAA,CAAc,UAAU,CAAA;AAEzC,EAAA,MAAM,mBAAsB,GAAA,MAAM,OAAQ,CAAA,GAAA,CAAI,IAAK,CAAA,GAAA,CAAI,CAAC,GAAA,KAAQ,QAAS,CAAA,UAAA,EAAY,GAAG,CAAC,CAAC,CAAA;AAC1F,EAAM,MAAA,cAAA,GAAiB,oBAAoB,IAAK,EAAA;AAEhD,EAAI,IAAA,OAAA,IAAW,cAAe,CAAA,MAAA,GAAS,CAAG,EAAA;AACtC,IAAM,MAAA,UAAA,GAAa,MAAM,cAAA,CAAe,UAAU,CAAA;AAClD,IAAA,OAAA,CAAQ,IAAI,UAAU,CAAA;AAAA;AAE9B,CAAA;;;ACvDO,IAAM,YAAN,MAAgB;AAAA;AAAA,EAEnB,OAAO,KAAQ,GAAA,SAAA;AAAA;AAAA,EAEf,OAAO,OAAU,GAAA,YAAA;AAAA;AAAA,EAEjB,OAAO,OAAU,GAAA,YAAA;AACrB","file":"index.cjs","sourcesContent":["import { type Construct } from 'constructs'\nimport path from 'path'\n\nconst SYNTH_PATH_KEY = '@cdklib/argocd/synthPath'\n\n/**\n * Adds a suffix to the synthesized path\n *\n * Use this to structure your environments / apps for ArgoCD\n */\nexport const addSynthPath = (scope: Construct, ...suffixes: string[]) => {\n let currentPath: string = ''\n try {\n currentPath = getSynthPath(scope)\n } catch {\n // no-op\n }\n\n const basePath = currentPath ? [currentPath] : []\n\n scope.node.setContext(SYNTH_PATH_KEY, path.join(...basePath, ...suffixes))\n}\n\n/**\n * Gets the synth path for the cdk8s App / Chart\n *\n * Uses context to store the path (addSynthPath)\n */\nexport const getSynthPath = (scope: Construct): string => {\n try {\n return scope.node.getContext(SYNTH_PATH_KEY)\n } catch (e) {\n if (e instanceof Error && e.message.includes('No context value')) {\n throw new Error('No synth path found - call addSynthPath first')\n }\n throw e\n }\n}\n","import { type App, Chart } from 'cdk8s'\nimport { addSynthPath } from 'src/paths'\n\n/**\n * Configuration for a GitOps Helm chart.\n *\n * @see {@link GitOpsHelmChart}\n */\nexport type GitOpsHelmChartConfig = {\n /** Name of the Helm chart */\n name: string\n\n /** Repository of the Helm chart */\n repository: string\n\n /** Version of the Helm chart */\n version: string\n\n /** Values to pass to the Helm chart */\n values: Record<string, unknown>\n\n /** Synth path (relative to the cdk8s App) to save the umbrella chart */\n synthPath: string | string[]\n}\n\n/**\n * Creates a Helm umbrella chart for Kubernetes addons.\n *\n * You can create Argo applications that point to this directory to manage the helm chart.\n *\n * The chart and full values are rendered to the output directory.\n *\n * Api Objects under the Helm Chart are rendered to the template/ directory, and will be managed by argo\n */\nexport class GitOpsHelmChart extends Chart {\n readonly name: string\n readonly version: string\n readonly repository: string\n readonly values: Record<string, unknown>\n\n constructor(\n scope: App,\n { name, values, synthPath, version, repository }: GitOpsHelmChartConfig,\n ) {\n super(scope, name, {})\n\n this.name = name\n this.version = version\n this.values = values\n this.repository = repository\n const pathParts = Array.isArray(synthPath) ? synthPath : [synthPath]\n\n addSynthPath(this, ...pathParts)\n }\n}\n","import { exec } from 'child_process'\nimport { mkdir } from 'fs/promises'\nimport { promisify } from 'util'\n\n/** Wipes a directory recursively. */\nexport const wipeDirectory = async (dirname: string) => {\n // rmdir force type is broken, don't wanna import a library jsut for it\n await promisify(exec)(`rm -rf ${dirname}`)\n\n await mkdir(dirname, { recursive: true })\n}\n\n/** Ensures a directory exists. */\nexport const ensureDirectory = async (dirname: string) => {\n await mkdir(dirname, { recursive: true })\n}\n","import { ApiObject, Yaml } from 'cdk8s'\nimport { type Construct } from 'constructs'\nimport { writeFile } from 'fs/promises'\nimport path from 'path'\nimport { getSynthPath } from 'src/paths'\nimport { ensureDirectory } from './fs'\n\ntype ApiObjectResult = { apiObject: ApiObject; outputPath: string }\n\n/** Returns all API objects and cdk8s-plus resources */\nexport const getApiObjects = (...scopes: Construct[]): ApiObjectResult[] =>\n scopes.flatMap(\n (s) =>\n s.node\n .findAll()\n .map((s): ApiObjectResult | undefined => {\n if (s instanceof ApiObject) return { apiObject: s, outputPath: getSynthPath(s) }\n\n /** Handle cdk8s-plus resources */\n const apiObject = (s as unknown as { apiObject: ApiObject }).apiObject\n if (apiObject) return { apiObject, outputPath: getSynthPath(s) }\n\n return undefined\n })\n .filter(Boolean) as ApiObjectResult[],\n )\n\n/** Synthesize all API object to the relevant path\n *\n * @param outputPath - the full path to the output directory\n * @param scope - the scope to synthesize\n */\nexport const synthApiObjects = async (outputPath: string, scope: Construct, suffix?: string) => {\n const apiObjects = getApiObjects(scope)\n if (!apiObjects.length) return\n\n const uniqueSubPaths = new Set(apiObjects.map(({ outputPath }) => outputPath))\n\n await Promise.all(\n Array.from(uniqueSubPaths).map((subPath) =>\n ensureDirectory(path.join(outputPath, subPath, ...(suffix ? [suffix] : []))),\n ),\n )\n\n // Render chart resources under templates/ directory\n await Promise.all(\n apiObjects.map(({ apiObject, outputPath: subPath }) => {\n return writeFile(\n path.join(\n outputPath,\n subPath,\n ...(suffix ? [suffix] : []),\n `${apiObject.kind}.${apiObject.name}.yaml`,\n ),\n Yaml.stringify(apiObject.toJson()),\n )\n }),\n )\n}\n","import { Yaml } from 'cdk8s'\nimport { writeFile } from 'fs/promises'\nimport path from 'path'\nimport { type GitOpsHelmChart } from '../helm/chart'\nimport { getSynthPath } from '../paths'\nimport { synthApiObjects } from './api-object'\nimport { ensureDirectory } from './fs'\n\nconst HELM_TEMPLATES_PATH = 'templates'\n\n/**\n * Synthesizes a helm umbrella chart.\n *\n * - Renders API objects under `templates/`\n * - Generates `Chart.yaml` and `values.yaml`\n */\nexport const synthHelmChart = async (outputPath: string, helmChart: GitOpsHelmChart) => {\n const { name, version, repository, values } = helmChart\n\n const chartOutputPath = path.join(outputPath, getSynthPath(helmChart))\n\n // Create the chart output directory\n await ensureDirectory(chartOutputPath)\n\n // Check if there are any API objects to synthesize\n const apiObjects = helmChart.apiObjects\n\n let apiObjectsPromise = Promise.resolve()\n\n if (apiObjects.length > 0) {\n // Only create templates directory if there are API objects\n const templatesOutputPath = path.join(chartOutputPath, HELM_TEMPLATES_PATH)\n await ensureDirectory(templatesOutputPath)\n\n apiObjectsPromise = synthApiObjects(outputPath, helmChart, HELM_TEMPLATES_PATH)\n }\n\n /** [Chart.yaml](https://v2.helm.sh/docs/developing_charts/#the-chart-yaml-file) content */\n const chartYaml = {\n apiVersion: 'v2',\n name,\n version,\n description: `${name} cluster addon, managed by CDK8S.`,\n dependencies: [{ name, repository, version }],\n }\n\n const chartYamlPromise = writeFile(\n path.join(chartOutputPath, 'Chart.yaml'),\n Yaml.stringify(chartYaml),\n )\n\n // Dependencies only respect values under chart name.\n const chartValues = { [name]: values }\n const valuesPromise = writeFile(\n path.join(chartOutputPath, 'values.yaml'),\n Yaml.stringify(chartValues),\n )\n\n await Promise.all([apiObjectsPromise, chartYamlPromise, valuesPromise])\n}\n","import { type App, type Chart } from 'cdk8s'\nimport { GitOpsHelmChart } from '../helm/chart'\nimport { synthApiObjects } from './api-object'\nimport { wipeDirectory } from './fs'\nimport { synthHelmChart } from './helm-chart'\nimport { exec } from 'child_process'\nimport { promisify } from 'util'\n\nconst execAsync = promisify(exec)\n\n/**\n * Synthesizes an application with regards to ArgoCD paths.\n *\n * @param outputPath - The base path to output the synthesized resources\n * @param app - The application to synthesize\n */\nexport const synthApp = async (outputPath: string, app: App) => {\n const helmCharts: GitOpsHelmChart[] = []\n const otherCharts: Chart[] = []\n\n app.charts.forEach((o) => {\n if (o instanceof GitOpsHelmChart && 'repository' in o) {\n helmCharts.push(o as GitOpsHelmChart)\n } else {\n otherCharts.push(o)\n }\n })\n\n const appSynthPromises = otherCharts.map(async (chart) => {\n await synthApiObjects(outputPath, chart)\n })\n\n await Promise.all([\n ...helmCharts.map((helmChart) => synthHelmChart(outputPath, helmChart)),\n ...appSynthPromises,\n ])\n}\n\ntype SynthOptions = {\n /**\n * Wipes the output directory before synthesizing.\n *\n * Recommended to enable this after you verify the output is correct.\n *\n * @default false\n */\n clean?: boolean\n\n /**\n * Whether to print a summary of synthesized files.\n *\n * @default true\n */\n summary?: boolean\n}\n\n/**\n * Creates a tree representation of synthesized files\n *\n * @param outputPath Directory containing synthesized files\n * @returns String representation of the file tree\n */\nconst createFileTree = async (outputPath: string): Promise<string> => {\n try {\n // Try to use the tree command if available\n const { stdout } = await execAsync(`tree ${outputPath} -I \"node_modules\"`)\n return stdout\n } catch {\n // Fall back to a simple listing if tree command is not available\n try {\n const { stdout } = await execAsync(`find ${outputPath} -type f | sort`)\n return stdout.split('\\n').filter(Boolean).join('\\n')\n } catch {\n return `Could not generate file listing for ${outputPath}.\\nPlease check the directory manually.`\n }\n }\n}\n\n/**\n * Synthesizes all applications with regards to ArgoCD paths.\n *\n * @param outputPath - The base path to output the synthesized resources\n * @param apps - The applications to synthesize\n * @param options - Synthesis options\n */\nexport const synthApps = async (\n outputPath: string,\n apps: App[],\n { clean = false, summary = true }: SynthOptions = {},\n) => {\n if (clean) await wipeDirectory(outputPath)\n\n const allSynthesizedFiles = await Promise.all(apps.map((app) => synthApp(outputPath, app)))\n const flattenedFiles = allSynthesizedFiles.flat()\n\n if (summary && flattenedFiles.length > 0) {\n const treeOutput = await createFileTree(outputPath)\n console.log(treeOutput)\n }\n}\n","import { addSynthPath, getSynthPath } from './paths'\nimport { synthApps } from './synth/synth'\nexport { GitOpsHelmChart, type GitOpsHelmChartConfig as GitOpsHelmChartOptions } from './helm/chart'\n\n/**\n * ArgoSynth provides utilities for organizing and synthesizing CDK8s apps into\n * directory structures that work well with ArgoCD's path-based application definitions.\n *\n * @example\n * ```typescript\n * import { App, Chart } from 'cdk8s';\n * import { ArgoSynth } from '@cdklib/argo-synth';\n *\n * // Create an app for each environment\n * const stagingApp = new App();\n * const prodApp = new App();\n *\n * // Create charts for your services\n * const stagingWebChart = new Chart(stagingApp, 'web');\n * const prodWebChart = new Chart(prodApp, 'web');\n *\n * // Set paths for ArgoCD directory structure\n * ArgoSynth.addPath(stagingWebChart, 'staging', 'web');\n * ArgoSynth.addPath(prodWebChart, 'prod', 'web');\n *\n * // Synthesize to output directory\n * await ArgoSynth.synth('gitops', [stagingApp, prodApp]);\n * ```\n *\n * This creates a directory structure like:\n * ```\n * gitops/\n * ├── staging/\n * │ └── web/\n * │ └── ... (manifests)\n * └── prod/\n * └── web/\n * └── ... (manifests)\n * ```\n *\n * Which maps cleanly to ArgoCD applications targeting paths like:\n * - `staging/web`\n * - `prod/web`\n */\nexport class ArgoSynth {\n /** Synthesizes multiple applications with regards to ArgoCD paths */\n static synth = synthApps\n /** Adds a suffix to the synthesized path for ArgoCD apps */\n static addPath = addSynthPath\n /** Gets the synth path for the cdk8s App / Chart */\n static getPath = getSynthPath\n}\n"]}