Skip to content

Commit 0106427

Browse files
committed
feat: add types for cd build pipeline
1 parent 484b290 commit 0106427

File tree

6 files changed

+99
-4
lines changed

6 files changed

+99
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.1.16",
3+
"version": "0.1.16-beta-3",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Pages/CDPipeline/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './types'

src/Pages/CDPipeline/types.tsx

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import { FormType, StepType } from '@Common/CIPipeline.Types'
2+
import { DeploymentAppTypes } from '@Common/Types'
3+
import { DeploymentStrategy } from '@Shared/Components'
4+
5+
interface ConfigSecretType {
6+
label: string
7+
value: string
8+
type: string
9+
}
10+
11+
export interface Environment {
12+
description?: string
13+
id: number
14+
name: string
15+
namespace: string
16+
active: boolean
17+
clusterName: string
18+
clusterId: string
19+
isClusterCdActive: boolean
20+
isVirtualEnvironment?: boolean
21+
allowedDeploymentTypes?: DeploymentAppTypes[]
22+
isDigestEnforcedForEnv?: boolean
23+
}
24+
25+
export interface PipelineBuildStageType {
26+
id: number
27+
triggerType?: string
28+
steps: StepType[]
29+
}
30+
31+
export interface SavedDeploymentStrategy extends DeploymentStrategy {
32+
isCollapsed?: boolean
33+
defaultConfig?: any
34+
yamlStr?: any
35+
jsonStr?: any
36+
}
37+
38+
export interface CustomTagType {
39+
tagPattern: string
40+
counterX: string
41+
}
42+
43+
export enum ReleaseMode {
44+
CREATE = 'create',
45+
LINK = 'link',
46+
}
47+
48+
export interface CDFormType {
49+
name: string
50+
ciPipelineId: number
51+
environmentId: number
52+
environmentName: string
53+
namespace: string
54+
environments: Environment[]
55+
deploymentAppType: string
56+
deploymentAppName?: string
57+
releaseMode: ReleaseMode
58+
triggerType: string
59+
preBuildStage?: PipelineBuildStageType
60+
postBuildStage?: PipelineBuildStageType
61+
strategies: DeploymentStrategy[]
62+
savedStrategies: SavedDeploymentStrategy[]
63+
preStageConfigMapSecretNames: { configMaps: ConfigSecretType[]; secrets: ConfigSecretType[] }
64+
postStageConfigMapSecretNames: { configMaps: ConfigSecretType[]; secrets: ConfigSecretType[] }
65+
requiredApprovals: string
66+
userApprovalConfig?: {
67+
requiredCount: number
68+
}
69+
isClusterCdActive: boolean
70+
deploymentAppCreated: boolean
71+
clusterId: string
72+
clusterName: string
73+
runPreStageInEnv: boolean
74+
runPostStageInEnv: boolean
75+
allowedDeploymentTypes: DeploymentAppTypes[]
76+
containerRegistryName: string
77+
repoName: string
78+
selectedRegistry: any
79+
generatedHelmPushAction: string
80+
}
81+
82+
export interface PipelineFormType extends Partial<FormType>, Partial<CDFormType> {
83+
name: string
84+
triggerType: string
85+
preBuildStage?: PipelineBuildStageType
86+
postBuildStage?: PipelineBuildStageType
87+
defaultTag?: string[]
88+
customTag?: CustomTagType
89+
enableCustomTag?: boolean
90+
customTagStage?: string
91+
isDigestEnforcedForPipeline?: boolean
92+
isDigestEnforcedForEnv?: boolean
93+
}

src/Pages/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616

1717
export * from './GlobalConfigurations'
1818
export * from './ResourceBrowser'
19+
export * from './CDPipeline'

src/Shared/Components/CICDHistory/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ export interface DeploymentHistory {
608608

609609
type DeploymentStrategyType = 'CANARY' | 'ROLLING' | 'RECREATE' | 'BLUE_GREEN'
610610

611-
interface DeploymentStrategy {
611+
export interface DeploymentStrategy {
612612
deploymentTemplate: DeploymentStrategyType
613613
config: any
614614
default: boolean

0 commit comments

Comments
 (0)