mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-21 18:59:27 +08:00
ecec5912ba
* switch none deployment strategy to basic * update readme * update deployment strategy fallthrough logic * comment fixed * add disclaimer for basic strategy only supporting deploy action
21 lines
609 B
TypeScript
21 lines
609 B
TypeScript
export enum DeploymentStrategy {
|
|
BASIC = 'basic',
|
|
CANARY = 'canary',
|
|
BLUE_GREEN = 'blue-green'
|
|
}
|
|
|
|
/**
|
|
* Converts a string to the DeploymentStrategy enum
|
|
* @param str The deployment strategy (case insensitive)
|
|
* @returns The DeploymentStrategy enum or undefined if it can't be parsed
|
|
*/
|
|
export const parseDeploymentStrategy = (
|
|
str: string
|
|
): DeploymentStrategy | undefined =>
|
|
DeploymentStrategy[
|
|
Object.keys(DeploymentStrategy).filter(
|
|
(k) =>
|
|
DeploymentStrategy[k].toString().toLowerCase() === str.toLowerCase()
|
|
)[0] as keyof typeof DeploymentStrategy
|
|
]
|