Description
Running faas-cli build
fails when templates are missing from the template folder. While the command should fail in this case the behaviour is confusing because it also fails for default templates from the official template repo while other commands like faas-cli publish
pull the default templates automatically when they are missing.
Expected Behaviour
Pull templates from the official template repo automatically when they are missing.
Current Behaviour
Running faas-cli build
does not pull the templates from the official template repo automatically.
Why do you need this?
Who is this for?
What company is this for? Are you listed in the ADOPTERS.md file?
Are you a GitHub Sponsor (Yes/No?)
Check at: https://github.com/sponsors/openfaas
- Yes
- No
List All Possible Solutions and Workarounds
Pull the default templates automatically before building.
Workaround: run faas-cli template pull
before faas-cli build
Which Solution Do You Recommend?
Make the beaviour consistent with the other commands and expand the template directory automatically.
Steps to Reproduce (for bugs)
- Remove the
template
directory from an existing functions project. - Run
faas-cli build
- See the build fail because of missing templates.
Context
This issue was discovered while splitting out the GitHub Actions workflow for the openfaas store functions.
Your Environment
- FaaS-CLI version ( Full output from:
faas-cli version
):
CLI:
commit: f8c3e0f878eec5c5bcfff315b7cc1f27d56344cc
version: 0.16.29
- Docker version ( Full output from:
docker version
):
Client: Docker Engine - Community
Version: 26.1.4
API version: 1.45
Go version: go1.21.11
Git commit: 5650f9b
Built: Wed Jun 5 11:28:57 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 26.1.4
API version: 1.45 (minimum version 1.24)
Go version: go1.21.11
Git commit: de5c9cf
Built: Wed Jun 5 11:28:57 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.33
GitCommit: d2d58213f83a351ca8f528a95fbd145f5654e957
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
-
Are you using Docker Swarm (FaaS-swarm ) or Kubernetes (FaaS-netes)?
-
Operating System and version (e.g. Linux, Windows, MacOS):
Linux, Ubuntu 22.04.4 LTS
- Link to your project or a code example to reproduce issue: