fnproject / cli

CLI tool for fnproject.
https://fnproject.io
Apache License 2.0
131 stars 67 forks source link

Fn deploy should be capable to create a function from func.yml only #243

Open denismakogon opened 6 years ago

denismakogon commented 6 years ago

Here's the use case. I have function implemented and it has its own func.yml, so i want to create more function with the same image, so i decided to create more folders with func.yml only, the structure looks like:

app/
---- function_1/
--------------- func.go
--------------- func.yml
--------------- Gopkg*
---- function_2/
--------------- func.yml (with the unique route and config)
---- function_3/
--------------- func.yml (with the unique route and config)
---- app.yml

But when trying to build the app, CLI fails with different errors depending on the content of the func.yml, but if doesn't have the runtime CLi fails with:

ERROR: deploy error on /Users/denismakogon/Documents/oracle/go/src/github.com/fnproject/skyhook/event-service-report/func.yml: Cannot build, no language helper found for

So, from the developers point of view there are two problems (appeared couple times in Slack):

rdallman commented 6 years ago

once we have triggers this is more seamless, since func.yaml can specify a trigger that only makes a new trigger with a certain function (so you can have e.g. trigger A, B, C that use function X). not worth investing time into adding this to current API imo. current thinking:

all that's in func.yaml would be (i.e. no func definition):

trigger:
  name: sayhello
  func: fn/yo:0.0.42

...

trigger:
  name: sup
  func: fn/yo:0.0.42

makes sense? any feedback?