Commit Graph

104 Commits

Author SHA1 Message Date
Zbynek Roubalik 541e8586f7
feat: function name matches KService name (#317)
* feat: function name matches KService name

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* fix typo

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-04-26 10:13:32 +02:00
Zbynek Roubalik a5cbe3061b
src: rename from faas to func (#253)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-01-21 17:10:39 +01:00
Kamesh Sampath 557361a374
feat: add spring cloud function runtime and templates (#231)
* feat: add spring cloud function runtime and templates

* docs: review updates

* squash: apply suggestions from code review

Co-authored-by: Lance Ball <lball@redhat.com>
2020-11-25 12:15:48 -05:00
Roland Huß 5dd72d7348
chore: Update help messages and adding examples. (#218)
* chore: Update help messages and adding examples.

This commit introduces fixes for the top-level help message as described in #187.

It does not address:

* #216 - Use `kn function` in help message when run as a plugin to kn
* #215 - Group main help message to put important commands to the top
* #214 - Make examples in usage message parameterizable
2020-11-06 14:11:57 -05:00
Zbynek Roubalik 470ebb9da4
rename function -> func (#217)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-11-06 12:47:30 +01:00
Zbynek Roubalik cd57692c9d
feat!: rename faas to function (#210)
* rename faas to function

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* function.yaml -> func.yaml

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-11-06 10:41:42 +01:00
Luke K 57e12362af
feat!: remove create cli subcommand (#180) 2020-11-06 17:08:49 +09:00
Matej Vasek 5182487df2
feat: user can set envvars 2020-10-13 14:11:06 +02:00
Lance Ball e425c8f081
src!: change all references of "repository" to "registry" for images (#156)
When dealing with images, instead of referring to an image repository,
let's instead use the more correct term "registry", even though we're
actually using "registry/namespace" in most case.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-10-08 10:58:17 +02:00
Zbynek Roubalik d5839ea6c1
feat!: combine deploy and update commands (#152)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-10-07 17:29:09 +02:00
Lance Ball a698f39d1d
chore: rename .faas.yaml to faas.yaml (#143)
Fixes: https://github.com/boson-project/faas/issues/142

Signed-off-by: Lance Ball <lball@redhat.com>
2020-09-29 10:27:04 -04:00
Lance Ball 05efee8c83
src: add Long command descriptions for each of the CLI commands (#133)
Uses the Cobra "Long" configuration for each command to provide more
descriptive text.

Example:

```console
faas help create                                                                                                      1.3m  Mon 21 Sep 2020 09:55:40 PM EDT
Create a new Function, including initialization of local files and deployment

Creates a new Function project at 'path'. If 'path' does not exist, it is
created. The function name is the name of the leaf directory at path. After
creating the project, a container image is created and is deployed. This
command wraps 'init', 'build' and 'deploy' all up into one command.

The runtime, trigger, image name, image repository, and namespace may all be
specified as flags on the command line, and will subsequently be the default
values when an image is built or a Function is deployed. If the image name and
image repository are both unspecified, the user will be prompted for a
repository name, and the image name can be inferred from that plus the function
name. The function name, namespace, image name and repository name are all
persisted in the project configuration file .faas.yaml.

Usage:
  faas create <path> [options] [flags]

Flags:
  -c, --confirm             Prompt to confirm all configuration options - $FAAS_CONFIRM
  -h, --help                help for create
  -i, --image string        Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --repository) - $FAAS_IMAGE
  -n, --namespace string    Override namespace into which the Function is deployed (on supported platforms).  Default is to use currently active underlying platform setting - $FAAS_NAMESPACE
  -r, --repository string   Repository for built images, ex 'docker.io/myuser' or just 'myuser'.  Optional if --image provided. - $FAAS_REPOSITORY
  -l, --runtime string      Function runtime language/framework. - $FAAS_RUNTIME (default "go")
      --templates string    Extensible templates path. - $FAAS_TEMPLATES (default "/home/lanceball/.config/faas/templates")
  -t, --trigger string      Function trigger (ex: 'http','events') - $FAAS_TRIGGER (default "http")

Global Flags:
      --config string   config file path (default "~/.faas/config")
  -v, --verbose         print verbose logs
```
2020-09-24 10:23:55 -04:00
Zbynek Roubalik 025862689e
feat: decouple function name from function domain (#127)
* decouple function name from function domain

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-09-24 09:52:22 -04:00
Lance Ball fae27dabc9
fix: correct value for config path and robustify (#130)
* fix: correct value for config path and robustify

The hardcoded, initial value for the configuration path was set to
`.faas/config`. But `configPath()` immediately sets this to the correct
value of ~/.config. Both the create and init commands use `configPath()`
to search for additional templates, if they exist, and were each doing
`filepath.Join(configPath(), "faas", "templates")`. This commit also
changes `configPath()` so that it is `~/.config/faas` and does so in a
cross platform friendly way. If the `$HOME` directory cannot be
determined, the config is assumed to be at `./.config/faas`.

* squash: remove config variable entirely
2020-09-21 14:35:46 -04:00
Lance Ball 3868ef3441 chore: remove [options] from usage string
The cobra package, magically appends "[flags]" to the usage string
if a command has flags. By adding "[options]" to the usage string,
we end up with help text that looks like this.

```
  faas init <name> [options] [flags]
```

This commit fixes that.
2020-09-19 17:23:08 -04:00
Lance Ball 566d8f9255 feat: default to no confirmation prompts for CLI commands
The CLI commands all printed confirmation prompts for the various flags
they exposed. This commit modifies that logic, so that there is no longer
a `-y` flag, but instead a `--confirm` or `-c` flag for each command, and
prompts are only displayed if using this flag. In most cases, the derived
values are printed even if not prompted for.

In call cases where the user is prompted, I have removed the "Verbose"
prompt, as that seems less like a configuration option that needs to be
confirmed, and more like just a CLI option for the current run which we
can just accept as-is.

The text for the prompts has also been reduced to one or two words.

Also added are some checks around image naming and repositories, short
circuiting failures that could occur if these are not specified or are
unknown. For example, if a user does `faas init` and then `faas deploy`
we don't yet know what the image name should be - one hasn't been built.

Fixes: https://github.com/boson-project/faas/issues/91
Fixes: https://github.com/boson-project/faas/issues/90
Fixes: https://github.com/boson-project/faas/issues/89
2020-09-11 14:36:34 -04:00
Matej Vasek 91172ef0b1
fix: image override (#88) 2020-09-02 08:37:17 -04:00
Luke K 00ac880c3b
docs: fix function typos 2020-08-29 01:55:33 +09:00
Luke K 4918cc7eef
feat: cli usability enhancements and API simplification 2020-08-29 01:54:13 +09:00
Luke K 2fcbe740e9
fix: default k8s namespace to 'faas' per documentation 2020-08-29 01:52:56 +09:00
Lance Ball 5b4d97a443
feat: add init/build/deploy commands and customizable namespace (#65)
* feat: add init/build/deploy commands and customizable namespace

This commit comprises some fairly large changes in the codebase.
The 'create' command has been extracted into 'init', 'bulid' and
'deploy' commands. The 'create' command remains, but now delegates
most of its work to these other three. This also has resulted in
some rework of the various flags. 

In addition, it is now possible to specify the cluster namespace to
which the function will be deployed.
2020-08-12 10:52:50 -04:00
Matej Vasek 4677b3452f
chore: add lint to GH actions CI 2020-07-29 17:47:08 +02:00
Luke K 7b0e59248d
Merge remote-tracking branch 'matej/imprv-deploy' into develop 2020-07-08 01:59:46 +00:00
Luke K 711094b02e
rename Service Function to simply Function 2020-07-02 14:52:27 +00:00
Luke K f23e81538f
rename language to runtime 2020-07-02 13:06:54 +00:00
Matej Vasek d503a73680 fix: remove dependency on `kn` binary 2020-07-01 17:02:19 +02:00
Luke K 5e621e583a
reference context from templates in main 2020-07-01 14:02:08 +00:00
Luke K 75cee352e5
templates flag defaulting to XDG or ~/.config 2020-06-11 12:25:34 +00:00
Luke K 5febf1ac4a
add function context (style) to Create 2020-06-11 12:23:49 +00:00
Matej Vasek 5e8dc8b5f7
feat: buildpacks
Implemented builder using buildpack.
2020-06-08 18:38:55 +02:00
Luke K b5a7f020a5
Merge remote-tracking branch 'matejvasek/shell-comp' into shell-comp 2020-06-01 11:18:55 +00:00
Luke K 5ec4ac644a
pass through verbose mode 2020-05-28 13:53:06 +00:00
Luke K 9671e5af74
progress indicator on create 2020-05-28 07:47:07 +00:00
Matej Vasek cdaa1869d2 Add some more completion 2020-05-27 19:32:39 +02:00
Matej Vasek 290b59ec12 Add shell completion fixes 2020-05-27 18:14:56 +02:00
Matej Vasek acbaf48c0b Add shell completion for bash and zsh 2020-05-26 23:15:37 +02:00
Luke K a0e9fcb11c
remove debug and cleanup 2020-05-25 08:56:46 +00:00
Luke K 032ab96787
gather create config from user using prompts 2020-05-25 08:43:55 +00:00
Luke K c12c5c17d2
gather create parameters into a structure 2020-05-23 03:30:40 +00:00
Luke K fd27affb4b
final url print placeholder 2020-05-23 01:25:12 +00:00
Luke K 88d806b52b
allow path to be provided to commands 2020-05-11 04:01:49 +00:00
Luke K 48e761c999
internal mode stub 2020-05-11 00:27:49 +00:00
Luke K be955cce39
update local mode to option 2020-05-11 00:24:11 +00:00
Luke K 1a3fbe294d
flatten package structure 2020-05-10 23:55:04 +00:00
Luke K 039e5506c4
create --internal stub 2020-04-28 16:25:40 +00:00
Matej Vasek 09cb2d5425 Rename packages
Needed since the project has been moved.
2020-04-27 16:45:46 +02:00
Luke K c0f0d34786
Support user-defined service name, persisted via config. 2020-04-23 10:31:21 +00:00
Luke K fe12839e97
updater: add kn-based implementation 2020-04-18 16:29:43 +00:00
Luke K 132ce75dda
service removal impl with directory state prereq checks on create 2020-04-12 17:59:08 +00:00
Luke K 8b404c090c
enable pusher and deployer in command 2020-04-11 19:45:05 +00:00
Luke K b2aebca0fe
create command builder integration 2020-04-09 16:27:33 +00:00
Luke K 0cc1788254
initial local create implementation using appsody delegate 2020-03-22 13:30:25 +00:00
Luke K c78be32b72
separate deploy from create for the --local flag 2020-03-04 15:12:05 +00:00
Luke K 86cdedec91
Initial Commit 2020-03-04 14:36:41 +00:00