本文整理汇总了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,
}
}