本文整理匯總了Golang中github.com/openshift/origin/pkg/generate/app.ReferenceBuilder.AddSourceRepository方法的典型用法代碼示例。如果您正苦於以下問題:Golang ReferenceBuilder.AddSourceRepository方法的具體用法?Golang ReferenceBuilder.AddSourceRepository怎麽用?Golang ReferenceBuilder.AddSourceRepository使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/openshift/origin/pkg/generate/app.ReferenceBuilder
的用法示例。
在下文中一共展示了ReferenceBuilder.AddSourceRepository方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: AddSourceRepositoriesToRefBuilder
// AddSourceRepositoriesToRefBuilder adds the provided repositories to the reference builder, identifies which
// should be built using Docker, and then returns the full list of source repositories.
func AddSourceRepositoriesToRefBuilder(b *app.ReferenceBuilder, repos []string, g *GenerationInputs) (app.SourceRepositories, error) {
for _, s := range repos {
if repo, ok := b.AddSourceRepository(s); ok {
repo.SetContextDir(g.ContextDir)
if g.Strategy == "docker" {
repo.BuildWithDocker()
}
}
}
if len(g.Dockerfile) > 0 {
if len(g.Strategy) != 0 && g.Strategy != "docker" {
return nil, errors.New("when directly referencing a Dockerfile, the strategy must must be 'docker'")
}
if err := AddDockerfileToSourceRepositories(b, g.Dockerfile); err != nil {
return nil, err
}
}
_, result, errs := b.Result()
return result, kutilerrors.NewAggregate(errs)
}