Commit Graph

38 Commits

Author SHA1 Message Date
Adam Boczek 2502819b61
feat: add pvc-size flag to deploy command (#851) (#1598)
* feat: add pvc-size flag to deploy command (#851)

* feat: move pvc-size from deploy to build func configuration section (#851)

* feat: add setting default value for pvc-size in func.yaml (#851)

* feat: change pvc-size to camel case (#851)

* feat: add omitempty to pvcSize (#851)

* feat: regenerate func yaml schema (#851)

* feat: update docs for deploy command (#851)

* feat: update usage help for the pvc-size flag (#851)
2023-04-05 11:54:39 +00:00
Manoel Marques 55f3d241dd
Include --builder option on func run command (#1614) 2023-03-14 08:23:57 +00:00
Dhruv Garg b03ada6c0d
docs: update broken links in docs to command.txt and command.md (#1613) 2023-03-10 17:50:24 +00:00
Manoel Marques fa3286ccac
Change 'create' help text to indicate mandatory language option (#1607) 2023-03-08 17:41:21 +00:00
Luke Kingland aa582dad21
cli help text updates and flags cleanup (#1564)
* cli help text and flags cleanup

- verbose flag uses global setting throughout
- confirm flag added using shared visitor throughout
- path flag added using shared visitor throughout
- removes --version flag on root as redundant with subcommand
- splits main help's 'Main Commands' into 'Primary Commands' and 'Development
  Commands' groups
- Moves RunE definition into flag struct literals

* remove commented code
2023-03-01 09:35:54 +00:00
Lance Ball 44bb13f803
feat: adds refspec support for `func repo add` (#1558)
* add option 'branch' to command 'repository add'

* Format go code (#1407)

Signed-off-by: Knative Automation <automation@knative.team>

* chore: refactor repository layout (#1554)

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

* fixup: removes --branch tag from repo commands

Removes the currently in-flight work on the `--branch` tag, simply
supporting a `refspec` on the repository URI. For example,
https://github.com/knative-sandbox/func-tastic#metacontroller will pull
the `func-tastic` repo, and set the currently active HEAD to the
`metacontroller` branch. Adds support for displaying this with the
command `func repo list -v`.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: add example to `func repo add` documentation

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: adjust test output expectations

Signed-off-by: Lance Ball <lball@redhat.com>

---------

Signed-off-by: Knative Automation <automation@knative.team>
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
Signed-off-by: Lance Ball <lball@redhat.com>
Co-authored-by: Yingchun Guo <yingchun.guo@intel.com>
Co-authored-by: knative-automation <automation@knative.team>
Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-02-16 04:05:51 +00:00
Luke Kingland 958429c2f3
feat: deploy command global config with function context (#1434)
* feat: deploy command global config function context

* fix static check errors

* fix test

* fix remote persists test

* env opaque box test

* use keyed fields (govet)

* mock deployer expansion

* ClearEnvs now in shared testing pkg

* effectivePath now uses plfags

* list directly uses config for default namespace

* Improved Namespace calculation and Caching

- Built() now a client package function
- Namespace evaluation delegeate to implementations
  This enables the func.yaml to avert dirtiness checks on rebuilds
  (caching)
- Build and Deploy update build stamp on completion
  Enables dirtiness checks to be unaffects, leading to better caching.
- CLI Namespace checks no longer require k8s env evaluation for default
- Fixed missing condition check in TestDeploy_Namespace
- Fixes some minor linter and spelling errors
- Global config does not directly set namespace - it is corrected to be
  deferred evaluation used by implementations.
- Skips writing func.yaml on f.Write if there were no modifications,
  which leads to better caching (no timestamp update means Built ==
  true)
- HasImage removed in favor of a corrected fn.Built

* linting, misspellings and docs rebuild

* warn user if git settings exist on a non-remote build

* lint error fix

* test flag unsetting persists

* allow unknown flags in preparsing of flags

* pre-submit cleanup

* update cmd to use client.Init
2023-02-06 08:43:35 +00:00
Luke Kingland be2e9ee970
rebuild docs (#1517) 2023-01-24 12:59:38 +00:00
Adam Boczek 2f021f118b
chore: refactor commands help to use templates (#1485)
* chore: extend help template engine and docs generator to get root use

* chore: refactor deploy cmd

* chore: refactor build cmd

* chore: refactor all relevant commands and remove defaultTemplatedHelp func

* chore: update docs

* chore: remove unused functions

* chore: add template func for rendering sub-templates

* chore: fix for typos
2023-01-16 20:40:53 +00:00
Luke Kingland eae7d56895
feat: command function context (#1416)
* feat: global config function context

The function with context is considered when determining flag defaults
such that:
- No special logic is required to determine "if changed"
- help text correctly reflects the actual values which will be used
- Global config can be a direct parent of command-specific config via
  embed
Also included:
- CLI tests clear environment of FUNC_* variables
- Command's bindEnv helper also sets up environment variable auto-binding
  and prefix.
- Verbosisty flag default now globally configurable

* Update cmd/build.go

Co-authored-by: Lance Ball <lball@redhat.com>

* Update cmd/build.go

Co-authored-by: Lance Ball <lball@redhat.com>

* Update cmd/build.go

Co-authored-by: Lance Ball <lball@redhat.com>

* move clearEnvs test function to test file

* docs regen

Co-authored-by: Lance Ball <lball@redhat.com>
2022-11-21 18:50:42 +00:00
Luke Kingland 5ca77d3874
src: update build command help text (#1425)
* src: build command help text

* Regen docs
2022-11-16 14:18:38 +00:00
Lance Ball 0073106832
documentation: remove old docs and restructure (#1430)
Removes old, outdated documentation and links to existing docs on https://knative.dev. Restructures some of the documentation directory, moving everything that is not generated out of the `reference` directory.

/kind documentation

Signed-off-by: Lance Ball <lball@redhat.com>

Signed-off-by: Lance Ball <lball@redhat.com>
2022-11-16 05:52:36 +00:00
Luke Kingland 11616840b9
path default cwd (#1411)
The system fully supports an empty (zero value) path as indicating
operations should take place on the current working directory by default.
2022-11-07 12:07:21 +00:00
Luke Kingland f9dc8b659f
chore: list command namespace (#1370)
* chore: list command namespace

- Adds namespace test to list command
- Moves namespace flag into list command for
  - Better help text
  - Easier testing
- Sets static default namespace for flag to "default"

* regen docs

* list test default from kubeconfig
2022-10-31 19:59:13 +00:00
Luke Kingland b8de6532fc
chore: delete command namespace (#1372)
* chore: delete command namespace

- Fixes bug where deleting by name fails if current path has no
  initialized function.
- Adds namespace test to delete command
- Moves namespace flag into delete command for
  - Better help text
  - Easier testing
- Sets static default namespace for flag to "default"

* fix comments/docs

* delete tests with nonexistent kubeconfig

* fix help text
2022-10-31 19:34:14 +00:00
Luke Kingland e9fb274969
feat: describe command namespace (#1381)
* fix: describe function

- Fixes error describing by name
- Adds ability to specify namespace
- Fixes inconsistency between Describe and Info

* fix misspelling

* clear test cmd args

* remove old doc file

* docs cleanup

* test describe with no kubeconfig
2022-10-31 19:03:12 +00:00
Luke Kingland 0fa9359750
feat: namespace globally configurable (#1352)
* namespace global config

* integrate namespace config into commands

* comment updates

* combine config write tests

* updates per code review

* regen docs
2022-10-31 18:07:12 +00:00
Luke Kingland 4a051d15fe
chore: update deploy help text (#1351) 2022-10-18 03:09:10 +00:00
Lance Ball 44ff20d782
chore: remove timestamp from generated docs (#1265)
This is causing trouble with new PRs that potentially change CLI flags
or other user-facing UX. Another option besides completely removing the
version information is to modify Version.StringVerbose() so that it uses
the value of the most recent semver tag (or Knative tag).

```
❯ git describe --match "v*"
v0.34.0-6-g6d26e64c

❯ git describe --match "knative*"
knative-v1.7.0-6-g6d26e64c
```

This is nice, but could be misleading if the UX has changed since that
release.

Signed-off-by: Lance Ball <lball@redhat.com>

Signed-off-by: Lance Ball <lball@redhat.com>
2022-09-21 13:55:10 +00:00
Zbynek Roubalik 50243c740a
feat: `invoke` - allow insecure connections over SSL (#1255)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2022-09-20 12:25:10 +00:00
Zbynek Roubalik 3d6ef471b7
chore: sync docs with source code (#1261)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2022-09-20 11:54:09 +00:00
Luke Kingland 15713b2a75
feat!: deploy autobuild and flag persistence (#1079)
* feat: deploy autobuild and flag persistence

* cleanup

* help text, comments and test cleanup

* removing usurped commands.txt

* add platform to deploy synopsis help
2022-09-14 11:45:10 +00:00
Matej Vasek 15e2363ffa
fixup: fix base for another PR (#1237)
PR author is not available for rebase.

Signed-off-by: Matej Vasek <mvasek@redhat.com>

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-09-13 21:46:47 +00:00
Adam Boczek 4d622bc007
feat: group main help message to put important commands to the top (#1152)
* feat: add initial version of command groups and template engine (#215)

* feat: add relevant dependencies and vendor files (#215)

* feat: extend TestUsageFlags for hidden flags and flags with no shorthand (#215)

* feat: refactor root.go to use command groups (#215)

* feat: move the long help of root cmd to the usage templates section (#215)

* feat: updates after rebase (#215)

* feat: update after review (#215)

* feat: rename 'options' into 'flags' to align with the old help (#215)

* feat: remove support for help options, add template for global flags help section (#215)

* feat: update handling of root command help to support proper use of templates and docs generation (#215)

* feat: generate new docs (#215)
2022-09-13 14:13:48 +00:00
Matej Vasek 17625b7c0d
docs: update podman doc (#1228)
Signed-off-by: Matej Vasek <mvasek@redhat.com>

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-09-09 09:43:24 +00:00
Matej Vasek a0b772c2cb
docs: update podman docs (#1220)
Signed-off-by: Matej Vasek <mvasek@redhat.com>

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-09-07 15:20:18 +00:00
Ying Chun Guo d0a181bd24
use correct sample repository name in command usage (#1207) 2022-08-31 11:19:16 +00:00
Lance Ball 34499bceee
doc: update generated docs for 'deploy' (#1203)
Signed-off-by: Lance Ball <lball@redhat.com>

Signed-off-by: Lance Ball <lball@redhat.com>
2022-08-30 20:24:16 +00:00
Matej Vasek 56b1db3500
Improve `func config envs` (#1188)
* Added ability to add env non-interactively
* Added ability to list envs as JSON

Signed-off-by: Matej Vasek <mvasek@redhat.com>

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-08-30 15:41:17 +00:00
Matej Vasek cd64b70b47
fix: trailing white spaces in genrated docs (#1198)
Signed-off-by: Matej Vasek <mvasek@redhat.com>

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-08-30 13:38:18 +00:00
Lance Ball 81289dc757
doc: use cobra markdown generator for command docs (#1169)
This commit removes the docs/reference/commands.txt file and instead
uses the Cobra built-in documentation generator to create markdown
documents for every command.

Signed-off-by: Lance Ball <lball@redhat.com>

Signed-off-by: Lance Ball <lball@redhat.com>
2022-08-25 13:16:19 +00:00
Zbynek Roubalik 1112aaa2fe
feat: S2I strategy for on cluster build (#1191)
* feat: S2I strategy for on cluster build

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

* use upstream `s2i` task only

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

* use custom func-s2i task

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2022-08-25 13:03:19 +00:00
Luke Kingland e6ec11b0e5
builder short name constants etc throughout (#1180)
* chore: shared builder constants etc

* pretty-print the shared unknown builder error

* update builder impls to use shared defs and validators

* error and docs text formatting

* include static default short names

* comment updates and typos

* docs paths

* use the constants for the in-package builder defaults

* use builders.All but with caviat
2022-08-24 19:34:18 +00:00
Luke Kingland fecbc4ef8b
chore: use dot as path default rather than absolute path (#1184)
* use '.' in flags to indicate default function path

* regen commands.txt with '.' as default path

* centralize dot expansion

* minor cleanup

* update all references to path flag

* exits should be panics
2022-08-24 11:02:18 +00:00
Lance Ball df022f5c93
docs: replace commands.md with generated text file (#1089)
* docs: replace commands.md with generated text file

This commit removes commands.md document which tends to get out of date
pretty easily and replaces it with a generated commands.txt file. The
help text generation is fairly naive, but should be sufficient for the
time being.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: tweak title formatting

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: run build-docs.sh again after recent change

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: add docs generation to make build target

Also removes the random UUID as the default for `invoke` since it's a
little misleading. That value will not be the one that's used, since
it's random. And because it's random, it changes the docs every time.

Signed-off-by: Lance Ball <lball@redhat.com>
2022-07-25 16:10:24 +00:00
Josh Gavant 3b9d6c2ee0
doc: add closing mark (#1073)
Without this the following section is unintentionally included in the code quote.
2022-06-20 07:07:16 +00:00
Lance Ball af916e7dd7
doc: fix some func.yaml fields (#1069)
* doc: fix some func.yaml fields

Addresses recent changes in func.yaml processing. Not all fields
for the file are documented. I'm not sure if they all should be.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup whitespace

Signed-off-by: Lance Ball <lball@redhat.com>
2022-06-16 17:16:17 +00:00
Lance Ball 76c647a1c7
docs: add a language pack "contract" document (#918)
* docs: restructure & add a language pack "contract"

The docs/guides/langugage-packs.md document does a good job of describing
what's required of a language pack in terms of directory structure and the
options for the `manifest.yaml` file. But it does a pretty crappy job of
describing the whole thing in context. I've tried to do that here.

Also some fixes to links and reorganization of the docs to make things a
little easier to find.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: inline language pack referenc into contract

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: minor wording tweak

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: whitespace

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-11 13:30:07 +00:00