Ejemplo n.º 1
0
func PrintJobInfo(w io.Writer, jobInfo *pps.JobInfo) {
	fmt.Fprintf(w, "%s\t", jobInfo.Job.Id)
	fmt.Fprintf(w, "%s/%s\t", jobInfo.Input.Repo.Name, jobInfo.Input.Id)
	if jobInfo.Output != nil {
		fmt.Fprintf(w, "%s/%s\t", jobInfo.Output.Repo.Name, jobInfo.Output.Id)
	} else {
		fmt.Fprintf(w, "-\t")
	}
	if jobInfo.GetPipeline() != nil {
		fmt.Fprintf(w, "%s\t", jobInfo.GetPipeline().Name)
	} else {
		fmt.Fprintf(w, "-\t")
	}
	if jobInfo.GetTransform() != nil {
		fmt.Fprintf(w, "%s\t", jobInfo.GetTransform().Image)
		fmt.Fprintf(w, "%s\t", strings.Join(jobInfo.GetTransform().Cmd, " "))
	} else {
		fmt.Fprintf(w, "-\t")
		fmt.Fprintf(w, "-\t")
	}
	if len(jobInfo.JobStatus) > 0 {
		fmt.Fprintf(w, "%s\t\n", jobInfo.JobStatus[0].Message)
	} else {
		fmt.Fprintf(w, "-\t\n")
	}
}
Ejemplo n.º 2
0
func PrintJobInfo(w io.Writer, jobInfo *pps.JobInfo) {
	fmt.Fprintf(w, "%s\t", jobInfo.Job.Id)
	for i, commit := range jobInfo.InputCommit {
		fmt.Fprintf(w, "%s/%s", commit.Repo.Name, commit.Id)
		if i == len(jobInfo.InputCommit)-1 {
			fmt.Fprintf(w, "\t")
		} else {
			fmt.Fprintf(w, ", ")
		}
	}
	fmt.Fprintf(w, "\t")
	if jobInfo.OutputCommit != nil {
		fmt.Fprintf(w, "%s/%s\t", jobInfo.OutputCommit.Repo.Name, jobInfo.OutputCommit.Id)
	} else {
		fmt.Fprintf(w, "-\t")
	}
	if jobInfo.GetPipeline() != nil {
		fmt.Fprintf(w, "%s\t", jobInfo.GetPipeline().Name)
	} else {
		fmt.Fprintf(w, "-\t")
	}
	if jobInfo.GetTransform() != nil {
		fmt.Fprintf(w, "%s\t", jobInfo.GetTransform().Image)
		fmt.Fprintf(w, "%s\t\n", strings.Join(jobInfo.GetTransform().Cmd, " "))
	} else {
		fmt.Fprintf(w, "-\t\n")
	}
}