@@ -12,17 +12,16 @@ const Main = "main"
1212const UniquePlaceHolderForAppName = "$etron"
1313
1414const PIPELINE_NAME_ALREADY_EXISTS_ERROR = "pipeline name already exist"
15+ const PIPELINE_TYPE_IS_NOT_VALID = "PipelineType is not valid for pipeline %s"
1516
1617type PipelineType string
1718
1819const (
19- NORMAL PipelineType = "NORMAL"
20- LINKED PipelineType = "LINKED"
21- // CI_EXTERNAL field is been sent from the dashboard in CreateLinkedCI request and directly gets saved to Database without any validations
22- CI_EXTERNAL PipelineType = "CI_EXTERNAL" // Deprecated Enum: TODO fix the PipelineTypes in code and database
23- EXTERNAL PipelineType = "EXTERNAL"
24- CI_JOB PipelineType = "CI_JOB"
25- LINKED_CD PipelineType = "LINKED_CD"
20+ CI_BUILD PipelineType = "CI_BUILD"
21+ LINKED PipelineType = "LINKED"
22+ EXTERNAL PipelineType = "EXTERNAL"
23+ CI_JOB PipelineType = "CI_JOB"
24+ LINKED_CD PipelineType = "LINKED_CD"
2625)
2726
2827type CiBuildConfigBean struct {
@@ -58,3 +57,12 @@ type BuildPackConfig struct {
5857 Args map [string ]string `json:"args"`
5958 ProjectPath string `json:"projectPath,omitempty"`
6059}
60+
61+ func (pType PipelineType ) IsValidPipelineType () bool {
62+ switch pType {
63+ case CI_BUILD , LINKED , EXTERNAL , CI_JOB , LINKED_CD :
64+ return true
65+ default :
66+ return false
67+ }
68+ }
0 commit comments