本文整理匯總了Golang中github.com/concourse/atc.JobConfig.Outputs方法的典型用法代碼示例。如果您正苦於以下問題:Golang JobConfig.Outputs方法的具體用法?Golang JobConfig.Outputs怎麽用?Golang JobConfig.Outputs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/concourse/atc.JobConfig
的用法示例。
在下文中一共展示了JobConfig.Outputs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Job
func Job(dbJob db.SavedJob, job atc.JobConfig, groups atc.GroupConfigs, finishedBuild, nextBuild *db.Build) atc.Job {
generator := rata.NewRequestGenerator("", routes.Routes)
req, err := generator.CreateRequest(
routes.GetJob,
rata.Params{"job": job.Name, "pipeline_name": dbJob.PipelineName},
nil,
)
if err != nil {
panic("failed to generate url: " + err.Error())
}
var presentedNextBuild, presentedFinishedBuild *atc.Build
if nextBuild != nil {
presented := Build(*nextBuild)
presentedNextBuild = &presented
}
if finishedBuild != nil {
presented := Build(*finishedBuild)
presentedFinishedBuild = &presented
}
groupNames := []string{}
for _, group := range groups {
for _, name := range group.Jobs {
if name == job.Name {
groupNames = append(groupNames, group.Name)
}
}
}
return atc.Job{
Name: job.Name,
URL: req.URL.String(),
Paused: dbJob.Paused,
FinishedBuild: presentedFinishedBuild,
NextBuild: presentedNextBuild,
Inputs: job.Inputs(),
Outputs: job.Outputs(),
Groups: groupNames,
}
}