Skip to content

Commit

Permalink
feat: pre-postcd trigger with plugin (#4176)
Browse files Browse the repository at this point in the history
* omit return error in modifications not found

* time

* comments

* pipeline type

* pipeline type

* check

* pipeline-type

* pipeline-type refactor
  • Loading branch information
Shivam-nagar23 committed Oct 31, 2023
1 parent 8ad9fe3 commit d05fd2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/pipeline/WorkflowDagExecutor.go
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,9 @@ func (impl *WorkflowDagExecutorImpl) buildWFRequest(runner *pipelineConfig.CdWor
return nil, err
}
ciProjectDetail.CommitTime = commitTime.Format(bean2.LayoutRFC3339)
} else if ciPipeline.PipelineType == bean3.CI_JOB {
// This has been done to resolve unmarshalling issue in ci-runner, in case of no commit time(eg- polling container images)
ciProjectDetail.CommitTime = time.Time{}.Format(bean2.LayoutRFC3339)
} else {
impl.logger.Debugw("devtronbug#1062", ciPipeline.Id, cdPipeline.Id)
return nil, fmt.Errorf("modifications not found for %d", ciPipeline.Id)
Expand Down Expand Up @@ -1218,6 +1221,7 @@ func (impl *WorkflowDagExecutorImpl) buildWFRequest(runner *pipelineConfig.CdWor
cdStageWorkflowRequest.SecretKey = ciPipeline.CiTemplate.DockerRegistry.AWSSecretAccessKey
cdStageWorkflowRequest.DockerRegistryType = string(ciPipeline.CiTemplate.DockerRegistry.RegistryType)
cdStageWorkflowRequest.DockerRegistryURL = ciPipeline.CiTemplate.DockerRegistry.RegistryURL
cdStageWorkflowRequest.CiPipelineType = ciPipeline.PipelineType
} else if cdPipeline.AppId > 0 {
ciTemplate, err := impl.CiTemplateRepository.FindByAppId(cdPipeline.AppId)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/pipeline/types/Workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ type WorkflowRequest struct {
WorkflowExecutor pipelineConfig.WorkflowExecutorType `json:"workflowExecutor"`
PrePostDeploySteps []*bean.StepObject `json:"prePostDeploySteps"`
CiArtifactLastFetch time.Time `json:"ciArtifactLastFetch"`
CiPipelineType string `json:"ciPipelineType"`
Type bean.WorkflowPipelineType
Pipeline *pipelineConfig.Pipeline
Env *repository.Environment
Expand Down

0 comments on commit d05fd2e

Please sign in to comment.