-
Notifications
You must be signed in to change notification settings - Fork 225
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
Add new build flag for local-run command #959
Conversation
Hi, thanks for the PR. I think what we're looking for is a Could you change the code and update the PR? Alex |
We have a community call tomorrow if you can make it? https://docs.openfaas.com/community/ |
554ca80
to
99f5a8e
Compare
c9dc19d
to
d570ea1
Compare
commands/local_run.go
Outdated
cmd.Flags().IntVarP(&opts.port, "port", "p", 8080, "port to bind the function to") | ||
cmd.Flags().StringVar(&opts.network, "network", "", "connect function to an existing network, use 'host' to access other process already running on localhost. When using this, '--port' is ignored, if you have port collisions, you may change the port using '-e port=NEW_PORT'") | ||
cmd.Flags().StringToStringVarP(&opts.extraEnv, "env", "e", map[string]string{}, "additional environment variables (ENVVAR=VALUE), use this to experiment with different values for your function") | ||
|
||
return cmd | ||
} | ||
|
||
func localBuild(cmd *cobra.Command, args []string) error { | ||
err := preRunBuild(cmd, args) |
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.
I think I'd probably inline these with if err:= .... ; err !=nil {
How does this work when there are flags that the build command uses like --build-arg
- which are not present in the local run command's flags?
I.e. faas-cli build --build-arg GO111MODULE=on
Have a look at how faas-cli up
works
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.
Made changes
Signed-off-by: Nikhil Sharma <nikhilsharma230303@gmail.com>
d570ea1
to
05c1c35
Compare
That looks more like what I was expecting to see 👍 @NikhilSharmaWe we'll review this / try it out on the community call in 20 minutes from now. |
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.
@alexellis i just tested this locally and everything works 100% as expected. the implementation also looks good
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
Thanks for working through this with us 👍
This'll be available soon via https://github.com/openfaas/faas-cli/releases/tag/0.16.4
|
Description
This PR adds a new flag
build
forlocal-run
command. If the value of thebuild
flag is set totrue
(default) then the function is built beforelocal-run
.Motivation and Context
How Has This Been Tested?
I have tested the new command locally and it works as expected.
--build=false
,local-run
command does not reflect the new changes made in the funtion.--build=true
it is not the case, the changes are reflected in the run, sincebuild
command logic is being executed before eachlocal-run
.Types of changes
Checklist:
git commit -s