Open alexellis opened 5 years ago
Will this affect the faas-cli new
command? If I already have a stack.yaml file in my directory and I do faas-cli new --lang go tester
, will tester be added to that file?
It will affect the --append
flag
I think, adding more background logic for priorities can be difficult or confusing for a new user.
How do you know that?
What if it gets added and we see what people think to it?
Personally I'd love to not have to put long -f
commands into every tutorial, workshop and blog post I write, so I can imagine that users would appreciate that too.
I will be working on it.
Feature: New priority order for YAML files
Expected Behaviour
In addition to the current behaviour this feature would allow a function YAML file to be picked up by all the commands if a
-f
orstack.yml
file is not in the current working directory.Current Behaviour
If a stack.yml file is not found in the current working directory then a
-f
flag is required and the name of a YAML file. i.e.faas-cli up -f fn1.yml
Create a function
Specify its YAML file
Rename to stack.yml and omit
-f
Possible Solution
After the feature is implemented the following would be possible:
Create a function
Specify no YAML file (as per stack.yml)
If more than one .yml or .yaml file is found then this feature would default to the current behaviour to avoid ambiguity.
If the YAML file in the current directory is not a valid stack file then we will see some sort of parsing error.
The final priority order is:
-f
(aka--yaml
)As with our other work, unit tests should be added to cover the priority-checking.