From 8d8ac76d37ea74281d12bb287eaf50f374670caa Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Mon, 27 Nov 2023 18:21:18 +0530 Subject: [PATCH 1/2] chore: add types for cd and ci pipeline --- src/Common/Types.ts | 148 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) diff --git a/src/Common/Types.ts b/src/Common/Types.ts index 265b3366a..eed5261b6 100644 --- a/src/Common/Types.ts +++ b/src/Common/Types.ts @@ -1,6 +1,8 @@ import React, { ReactNode, CSSProperties } from 'react' import { Placement } from 'tippy.js' import { ImageComment, ReleaseTag } from './ImageTags.Types' +import { DockerConfigOverrideType, TaskErrorObj } from '.' + export interface ResponseType { code: number status: string @@ -474,3 +476,149 @@ export interface AsyncState { export interface AsyncOptions { resetOnChange: boolean } + +export interface AppEnvironment { + environmentId: number + environmentName: string + appMetrics: boolean + infraMetrics: boolean + prod: boolean + chartRefId?: number + lastDeployed?: string + lastDeployedBy?: string + lastDeployedImage?: string + appStatus?: string + deploymentAppDeleteRequest?: boolean + isVirtualEnvironment?: boolean + isProtected?: boolean + pipelineId?: number + latestCdWorkflowRunnerId?: number +} + +export interface Strategy { + deploymentTemplate: string + config: any + default?: boolean +} + +export interface CDStage { + status: string + name: string + triggerType: 'AUTOMATIC' | 'MANUAL' + config: string +} + +export interface CDStageConfigMapSecretNames { + configMaps: any[] + secrets: any[] +} + +export interface PrePostDeployStageType { + isValid: boolean + steps: TaskErrorObj[] + triggerType: string + name: string + status: string +} + +export interface CdPipeline { + id: number + environmentId: number + environmentName?: string + description?: string + ciPipelineId: number + triggerType: 'AUTOMATIC' | 'MANUAL' + name: string + strategies?: Strategy[] + namespace?: string + appWorkflowId?: number + deploymentTemplate?: string + preStage?: CDStage + postStage?: CDStage + preStageConfigMapSecretNames?: CDStageConfigMapSecretNames + postStageConfigMapSecretNames?: CDStageConfigMapSecretNames + runPreStageInEnv?: boolean + runPostStageInEnv?: boolean + isClusterCdActive?: boolean + parentPipelineId?: number + parentPipelineType?: string + deploymentAppDeleteRequest?: boolean + deploymentAppCreated?: boolean + userApprovalConfig?: UserApprovalConfigType + isVirtualEnvironment?: boolean + deploymentAppType: DeploymentAppTypes + helmPackageName?: string + preDeployStage?: PrePostDeployStageType + postDeployStage?: PrePostDeployStageType + isProdEnv?: boolean +} + +export interface ExternalCiConfig { + id: number + webhookUrl: string + payload: string + accessKey: string +} + +export interface Source { + type: string + value?: string + regex?: string +} + +export interface CiMaterial { + source: Source + gitMaterialId: number + id: number + gitMaterialName: string + isRegex?: boolean +} + +export interface Task { + name?: string + type?: string + cmd?: string + args?: Array +} + +export interface CiScript { + id: number + index: number + name: string + script: string + outputLocation?: string +} + +export interface CiPipeline { + isManual: boolean + dockerArgs?: Map + isExternal: boolean + parentCiPipeline: number + parentAppId: number + externalCiConfig: ExternalCiConfig + ciMaterial?: CiMaterial[] + name?: string + id?: number + active?: boolean + linkedCount: number + scanEnabled: boolean + deleted?: boolean + version?: string + beforeDockerBuild?: Array + afterDockerBuild?: Array + appWorkflowId?: number + beforeDockerBuildScripts?: Array + afterDockerBuildScripts?: Array + isDockerConfigOverridden?: boolean + dockerConfigOverride?: DockerConfigOverrideType + appName?: string + appId?: string + componentId?: number + isCITriggerBlocked?: boolean + ciBlockState?: { + action: any + metadataField: string + } + isOffendingMandatoryPlugin?: boolean + pipelineType?: string +} From 6b10932db6429247aa9d0b97b1586db3772a8e3d Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Mon, 27 Nov 2023 18:25:11 +0530 Subject: [PATCH 2/2] chore: update package json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 459b78418..48516f3f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "0.0.41", + "version": "0.0.41-beta-7", "description": "Supporting common component library", "main": "dist/index.js", "scripts": {