Exemple #1
0
func (f *factory) loadBuilderFactory() biinstancestate.BuilderFactory {
	if f.stateBuilderFactory != nil {
		return f.stateBuilderFactory
	}

	erbRenderer := bitemplateerb.NewERBRenderer(f.fs, f.loadCMDRunner(), f.logger)
	jobRenderer := bitemplate.NewJobRenderer(erbRenderer, f.fs, f.logger)
	jobListRenderer := bitemplate.NewJobListRenderer(jobRenderer, f.logger)

	sha1Calculator := bicrypto.NewSha1Calculator(f.fs)

	renderedJobListCompressor := bitemplate.NewRenderedJobListCompressor(
		f.fs,
		f.loadCompressor(),
		sha1Calculator,
		f.logger,
	)

	f.stateBuilderFactory = biinstancestate.NewBuilderFactory(
		f.loadCompiledPackageRepo(),
		f.loadReleaseJobResolver(),
		jobListRenderer,
		renderedJobListCompressor,
		f.logger,
	)
	return f.stateBuilderFactory
}
func (c *installerFactoryContext) JobRenderer() JobRenderer {

	erbRenderer := bierbrenderer.NewERBRenderer(c.fs, c.runner, c.logger)
	jobRenderer := bitemplate.NewJobRenderer(erbRenderer, c.fs, c.logger)
	jobListRenderer := bitemplate.NewJobListRenderer(jobRenderer, c.logger)

	return NewJobRenderer(
		jobListRenderer,
		c.extractor,
		c.Blobstore(),
	)
}