Skip to content

Feature: New priority order for YAML files #635

Open
@alexellis

Description

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 or stack.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

faas-cli new --lang go tester

Specify its YAML file

faas-cli up -f tester.yml

Rename to stack.yml and omit -f

mv tester.yml stack.yml
faas-cli up

Possible Solution

After the feature is implemented the following would be possible:

Create a function

faas-cli new --lang go tester

Specify no YAML file (as per stack.yml)

faas-cli up

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)
  • slack.yml
  • a YAML or YML file in the directory if it's the only one present

As with our other work, unit tests should be added to cover the priority-checking.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions