// CIPlayOrRetry runs a job either by playing it for the first time or by
// retrying it based on the currently known job state
CIPlayOrRetry runs a job either by playing it for the first time or by
retrying it based on the currently known job state
// CIPlayOrRetry runs a job either by playing it for the first time or by // retrying it based on the currently known job state
func CIPlayOrRetry(pid interface{}, jobID int, status string) (*gitlab.Job, error) {
	switch status {
	case "pending", "running":
		return nil, nil
	case "manual":
		j, _, err := lab.Jobs.PlayJob(pid, jobID)
		if err != nil {
			return nil, err
		}
		uncachePipeline(j.Pipeline.ID)
		return j, nil
	default:
		j, _, err := lab.Jobs.RetryJob(pid, jobID)
		if err != nil {
			return nil, err
		}
		uncachePipeline(j.Pipeline.ID)
		return j, nil
	}
}
func CIPlayOrRetry ( pid interface { } , jobID int , status string ) ( * gitlab . Job , error ) { switch status { case " " , " " : return nil , nil case " " : j , _ , err := lab . Jobs . PlayJob ( pid , jobID ) if err != nil { return nil , err } uncachePipeline ( j . Pipeline . ID ) return j , nil default : j , _ , err := lab . Jobs . RetryJob ( pid , jobID ) if err != nil { return nil , err } uncachePipeline ( j . Pipeline . ID ) return j , nil } }
CIPlayOrRetry runs a job either by playing it for the first time or by
retrying it based on the currently known job state
CIPlayOrRetry runs a job either by playing it for the first time or by retrying it based on the currently known job state