Skip to content

Commit 6829c54

Browse files
committed
feat: enhance deployment workflow by adding CD workflow type determination
1 parent c24bf63 commit 6829c54

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Shared/Components/CICDHistory/TriggerOutput.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
URLS,
2828
ServerError,
2929
mapByKey,
30+
DeploymentNodeType,
3031
} from '../../../Common'
3132
import {
3233
FetchIdDataStatus,
@@ -44,7 +45,7 @@ import { DeploymentHistoryConfigDiff } from './DeploymentHistoryConfigDiff'
4445
import { GitChanges, Scroller } from './History.components'
4546
import Artifacts from './Artifacts'
4647
import TriggerDetails from './TriggerDetails'
47-
import { EMPTY_STATE_STATUS } from '../../constants'
48+
import { DeploymentStageType, EMPTY_STATE_STATUS } from '../../constants'
4849
import './cicdHistory.scss'
4950

5051
const HistoryLogs: React.FC<HistoryLogsProps> = ({
@@ -82,11 +83,24 @@ const HistoryLogs: React.FC<HistoryLogsProps> = ({
8283
envId: string
8384
}>()
8485

86+
const getCDWorkflowType = () => {
87+
if (triggerDetails.stage === DeploymentStageType.PRE) {
88+
return DeploymentNodeType.PRECD
89+
}
90+
91+
if (triggerDetails.stage === DeploymentStageType.POST) {
92+
return DeploymentNodeType.POSTCD
93+
}
94+
95+
return DeploymentNodeType.CD
96+
}
97+
8598
const paramsData = {
8699
appId,
87100
envId,
88101
appName: `${triggerDetails.helmPackageName}.tgz`,
89102
workflowId: triggerDetails.id,
103+
cdWorkflowType: getCDWorkflowType(),
90104
}
91105

92106
const CDBuildReportUrl = `app/cd-pipeline/workflow/download/${appId}/${envId}/${pipelineId}/${triggerId}`

0 commit comments

Comments
 (0)