Azure / draft

A day 0 tool for getting your app on k8s fast
MIT License
515 stars 61 forks source link

dockerfile builders template portability #127

Closed davidgamero closed 2 years ago

davidgamero commented 2 years ago

The current implementation doesn't allow the languages package to be imported for use outside draft as it relies on the builders embed in /pkg/languages which embeds the /pkg/languages/builders directory that is only populated after go:generate is executed through the makefile.

Since the draft makefile isn't executed when importing draft packages, the /pkg/languages/builders directory doesn't exist and the embed fails.

By creating a builders property on the languages struct and creating a public embed of the /templates/builders folder,

l.createDockerfileForLanguage(lang,inputs,templateWriter)

imiller31 commented 2 years ago

LGTM merging