Commit Graph

2073 Commits

Author SHA1 Message Date
Zbynek Roubalik 2c7c18dd9b
chore: commands are checking that Function is initialized (#162)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-10-08 15:32:46 +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
Lance Ball 6d301257f5
chore(templates): bump faas-js-runtime to 0.3.0 and update the name (#150)
* chore(templates): bump faas-js-runtime to 0.3.0 and update the name

The module name lost its @redhat prefix, and bumped a version. This
pulls in that latest dependency.

Running pkger for the first time on a new system also resulted in a
minor version bump for that dependency.


Signed-off-by: Lance Ball <lball@redhat.com>
2020-10-07 17:48:30 -04: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
Zbynek Roubalik 3c0b2bb4d1
chore: ignore vscode files (#153)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-10-06 21:23:36 +02:00
Matej Vasek d82230353d
feat: fish completion 2020-10-06 15:39:07 +02:00
Matej Vasek bf9b048813
fix: stop using manually edited completion 2020-10-05 22:06:49 +02:00
Matej Vasek c2b4a304bd
feat: ability for users to specify custom builders (#147)
* refactor: functionWithOverrides
* feat: custom Buildpacks builder
* fix: namespaces
2020-10-05 10:29:51 -04:00
Roland Huß 5fe70526e5
fix: update to Knative 0.17 (#145)
Also adjusted some dependencies and overwrite version to align
transitive dependencies.

Not sure why buildpack uses such an older docker dependency but that
clases with the docker dependency that is introduced by knative-dev/test-infra
(which is a dependency of the knative direct dependencies)

If there is a way to exclude a transitive dependency like that on test-infra,
this could be the better way to achieve the same result.

The build now works on macOs natively which was not the case before.
2020-10-05 10:28:37 -04:00
Lance Ball 54e9b2703e
chore(actions): update release-please-action to latest 2.4.1 (#146)
Signed-off-by: Lance Ball <lball@redhat.com>
2020-10-02 11:46:55 -04:00
Matej Vasek 06391a4243
chore: update go cloudevent sdk dep 2020-09-29 18:24:53 +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 05196a66b7
chore(ci): fix release binary uploads (#139)
There was a typo in the upload part of the CI. Also, there was a section
that (thankfully) did not run, which would have created a second release.
Moved the release-please action later in CI so less time elapses between
the creation of the release, and the upload of the binaries.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-09-29 09:22:00 -04:00
github-actions[bot] 40962fc645
chore: release 0.7.0 (#116)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-09-24 14:33:31 -04:00
Lance Ball d6e131f915
feat: set builder images in templates and .faas.yaml (#136)
This commit adds a .builder.yaml file to each template directory. In the file
there is at the moment a single key/value pair, "default: <image>", where the
actual builder image name is <image>. Using a mapping allows the future
possibility that a user may specify a builder image by name via a flag on the
command line. For example,

```console
faas build --builder native
```

When a project is initialized, the .builder.yaml file is read, and the default
builder is saved in the project's .faas.yaml file. The .faas.yaml file is then
consulted when building an image with `faas build`. If the builder image is
specified, then the builder will use it. Otherwise, it will fallback to the
defaults. This allows developers to create custom builders, and specify them
in the configuration file.

After extracting the builder image from .builder.yaml in the project directory,
this file is deleted.

This commit also adds Verbose to the init command.
2020-09-24 11:41:34 -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
Matej Vasek 02309a24a1
fix: sync package-lock.json (#137) 2020-09-24 09:18:02 -04:00
Zbynek Roubalik 7e298fd7d7
use go 1.14 (#134)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-09-22 12:43:45 -04:00
Lance Ball 1b0bb15147
feat: add local debugging to node.js templates (#132)
This commit adds nodemon and an `npm run debug` command to the Node.js
templates to support debugging on localhost.
2020-09-22 09:32:23 -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 341d3d2064
docs: add documentation for CLI commands (#128)
Adds a document outlining each of the CLI commands
2020-09-21 14:25:50 -04:00
Matej Vasek 279e990843
chore: update Quarkus version to 1.8.1.Final 2020-09-21 15:08:15 +02: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 5b93955f8b chore: remove dead appsody code
All of the code in `./appsody` is no longer used. This commit simply
removes it from the repo.
2020-09-16 11:34:00 -04:00
Matej Vasek b7670a3f7b
chore: run GH actions on Windows and macOS 2020-09-16 17:29:13 +02:00
Matej Vasek 7a648d2d23
chore: update `pack` dep version 2020-09-16 17:27:11 +02: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 6c16e65d60 fix: describe works without Eventing 2020-09-10 10:06:20 -04:00
Matej Vasek 284b77f7ef fix: delete command
There was hard-coded `faas` namespace.
2020-09-10 10:06:20 -04:00
Lance Ball 8a60c5e0c4 feat(ci/cd): add release-please for automated release management
This commit adds release-please as a github action, replacing the
develop, main and releases actions. Now, with each commit to main, a PR
is either created or updated with the contents of all changes since the
last release. When this PR is landed, a tag and branch are created, and
the build artifacts (binaries) are uploaded as part of a regular github
release.

A practical result of this landing will be that all work will subsequently
happen on the `main` branch (aside from backport releases) and the `develop`
branch will no longer be used.

When this is landed on `main`, a release will not be created as per usual.
Instead, a PR will be created with the contents of the changes since the
last release.
2020-09-10 09:49:54 -04:00
Luke K 6fb0116a86
release: v0.6.2 2020-09-09 23:10:18 +09:00
Luke K fffb1f28bc
build: remove main branch from release 2020-09-09 23:09:03 +09:00
Matej Vasek 8012e195c3
fix: update pkger generated files 2020-09-09 15:45:35 +02:00
Matej Vasek bb575b04c0
fix: signature of HTTP go function in template 2020-09-09 15:27:38 +02:00
Luke K bcd692be77
release: v0.6.1 2020-09-09 19:12:03 +09:00
Matej Vasek 565066ef4b
chore: update quarkus version to 1.7.2.Final 2020-09-08 21:23:56 +02:00
Lance Ball 609ab86a4d
templates(node): make node templates use npx @redhat/faas-js-runtime (#99)
Currently the templates have a `local.js` file and an explicit dependency
on the @redhat/faas-js-runtime module. This removes that build-time
dependency and replaces it with a runtime dependency by using the (pending)
CLI from the module.

This is nice for a couple of reasons.

- Reduces the build time during `faas deploy`
- Eliminates the need for `faas` to bump with updates to faas-js-runtime

See: https://github.com/boson-project/faas-js-runtime
2020-09-08 14:16:51 -04:00
Lance Ball 9826487044
chore(actions): add binary uploads to develop branch CI (#104)
This will enable non-developers who are interested in trying out the
latest builds to easily get a copy pre-release.
2020-09-04 12:11:54 -04:00
Luke K be8c9eb52a
fix: build releases from main branch only 2020-09-04 23:21:38 +09:00
Luke K cda3a98e9a
chore: use organization-level secrets for image deployment 2020-09-04 23:17:04 +09:00
Luke K ce48083a10
fix: remove references to unused binaries appsody, kn, kubectl 2020-09-04 23:08:03 +09:00
Luke K 3d51c27c6c
docs: initial Go template READMEs 2020-09-04 22:27:16 +09:00
Matej Vasek 91172ef0b1
fix: image override (#88) 2020-09-02 08:37:17 -04:00
Luke K 8262aa110b
release: v0.6.0 2020-08-31 19:08:55 +09:00
Luke K 38d41baaa3
feat: golangci-lint allow enum shorthand, use config file 2020-08-31 17:10:08 +09:00
Luke K 3fc39aa773
feat: consolidate formatters
- Replaces globally-scoped formatter function with methods
- Defines enumerated Format types
- Renames the 'output' flag 'format' due to confusion with command file descriptors
- FunctionDescription now Function
- Global verbose flag replaced with config struct based value throughout
2020-08-31 16:37:07 +09:00
Luke K 89c09d9a78
fixup: remove unnecessary WithVerbose option from progressListener 2020-08-31 09:45:20 +09:00
Luke K 00ac880c3b
docs: fix function typos 2020-08-29 01:55:33 +09:00
Luke K adcd93d70c
fix: return fs errors on config creation 2020-08-29 01:55:33 +09:00