-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: set builder images in templates and .faas.yaml #136
Conversation
I think it's OK to delete the file for now. In future I will add a feature for build modes (like |
templates/go/events/.builder.yaml
Outdated
@@ -0,0 +1 @@ | |||
default: nodejs quay.io/boson/faas-go-builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nodejs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, there's just the typo in the go events builder
+1 to delete the file afterwards
buildpacks/builder.go
Outdated
if f.Builder != "" { | ||
packBuilder = f.Builder | ||
} else { | ||
packBuilder = Runtimes[f.Runtime] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runtimes
var name seems odd in this context, maybe it could be Buildpacks
or Runtime2Buildpack
, I know you haven't introduced that name.
so what if we name the file |
This commit adds a .builder.yaml file to each template directory. In the file there is at the moment a single key/value pair, "default: <image>", where the actual builder image name is <image>. Using a mapping allows the future possibility that a user may specify a builder image by name via a flag on the command line. For example, ```console faas build --builder native ``` When a project is initialized, the .builder.yaml file is read, and the default builder is saved in the project's .faas.yaml file. The .faas.yaml file is then consulted when building an image with `faas build`. If the builder image is specified, then the builder will use it. Otherwise, it will fallback to the defaults. This allows developers to create custom builders, and specify them in the configuration file. After extracting the builder image from .builder.yaml in the project directory, this file is deleted. This commit also adds Verbose to the init command.
734bd33
to
f90036b
Compare
I've incorporated all of the feedback @zroubalik @matejvasek - ty! |
This commit adds a .builder.yaml file to each template directory. In the file
there is at the moment a single key/value pair, "
default: <image>
", where theactual builder image name is
<image>
. Using a mapping allows the futurepossibility that a user may specify a builder image by name via a flag on the
command line.
When a project is initialized, the .builder.yaml file is read, and the default
builder is saved in the project's .faas.yaml file. The .faas.yaml file is then
consulted when building an image with
faas build
. If the builder image isspecified, then the builder will use it. Otherwise, it will fallback to the
defaults. This allows developers to create custom builders, and specify them
in the configuration file.
An open question is whether the .builder.yaml file should be deleted after it
is read during project initialization. The
init
command is the only time thefile is consulted, and it may be confusing for the user if they discover a
second configuration-y file in the project directory.
Fixes: #120