-
Notifications
You must be signed in to change notification settings - Fork 0
/
tekton.go
34 lines (32 loc) · 1.77 KB
/
tekton.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package service
import (
"github.com/klovercloud-ci-cd/core-engine/core/v1"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
corev1 "k8s.io/api/core/v1"
)
// Tekton tekton related operations.
type Tekton interface {
InitPipelineResources(step v1.Step, label map[string]string, processId string) (input v1alpha1.PipelineResource, output []v1alpha1.PipelineResource, err error)
InitTask(step v1.Step, label map[string]string, processId string) (v1alpha1.Task, error)
InitTaskRun(step v1.Step, label map[string]string, processId string) (v1alpha1.TaskRun, error)
CreatePipelineResource(v1alpha1.PipelineResource) error
CreateTask(v1alpha1.Task) error
CreateTaskRun(v1alpha1.TaskRun) error
DeletePipelineResourceByProcessId(processId string) error
DeletePipelineResources(pipelineResourcesList []string) error
DeleteTaskByProcessId(processId string) error
DeleteTasks(taskList []string) error
DeletePipelineByProcessId(processId string) error
DeletePipelineRunByProcessId(processId string) error
DeleteTaskRunByProcessId(processId string) error
DeleteTaskRuns(taskRunsList []string) error
PurgeByProcessId(processId string)
GetTaskRun(name string, waitUntilTaskRunIsCompleted bool) (*v1alpha1.TaskRun, error)
GetPipelineRun(companyId, name, id, stepType string, waitUntilPipelineRunIsCompleted bool, podList corev1.PodList, claim int) (*v1beta1.PipelineRun, error)
CreatePipeline(pipeline v1beta1.Pipeline) error
InitPipeline(step v1.Step, label map[string]string, processId string) v1beta1.Pipeline
CreatePipelineRun(pipelineRun v1beta1.PipelineRun) error
InitPipelineRun(step v1.Step, label map[string]string, processId string) (v1beta1.PipelineRun, error)
GetTaskRunByName(step,processId string)(*v1alpha1.TaskRun, error)
}