Skip to content

Commit

Permalink
Kyma CLI documentation generation (kyma-project#222)
Browse files Browse the repository at this point in the history
* Kyma documentation generation

* Docs generation moved to separate binary

* Docs and generated docs are now part of the repo. Fixed docs generation path
  • Loading branch information
Igor authored Sep 3, 2019
1 parent 90b8c27 commit 15ff179
Show file tree
Hide file tree
Showing 19 changed files with 546 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ vendor
go.mod
go.sum
bin

# IDEs
.idea
.vscode
.vscode
24 changes: 22 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ required = [
[[constraint]]
name = "github.com/stretchr/testify"
version = "1.3.0"

[[override]]
name = "github.com/russross/blackfriday"
version = "1.4.0"
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ build-darwin: generate
generate:
go generate ./...

.PHONY: docs
docs:
go run ./cmd/gendocs/gendocs.go

.PHONY: test
test:
go test ./...
Expand Down
23 changes: 23 additions & 0 deletions cmd/gendocs/gendocs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package main

import (
"fmt"
"os"

"github.com/kyma-project/cli/cmd/kyma"
"github.com/kyma-project/cli/internal/cli"
"github.com/spf13/cobra/doc"
)

const DocsTargetDir = "./docs/gen-docs"

func main() {
command := kyma.NewCmd(cli.NewOptions())
err := doc.GenMarkdownTree(command, DocsTargetDir)
if err != nil {
fmt.Println("unable to generate docs", err.Error())
os.Exit(1)
}
fmt.Println("Docs successfully generated to the following dir", DocsTargetDir)
os.Exit(0)
}
32 changes: 32 additions & 0 deletions docs/gen-docs/kyma.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## kyma

Controls a Kyma cluster.

### Synopsis

Kyma is a flexible and easy way to connect and extend enterprise applications in a cloud-native world.
Kyma CLI allows you to install and manage Kyma.

For more information, see: https://github.com/kyma-project/cli


### Options

```
-h, --help help for kyma
--kubeconfig string Path to kubeconfig (default "/Users/i504462/.kube/config")
--non-interactive Do not use spinners
-v, --verbose verbose output
```

### SEE ALSO

* [kyma completion](kyma_completion.md) - Generates bash completion scripts
* [kyma console](kyma_console.md) - Open the Kyma console in a web browser
* [kyma install](kyma_install.md) - Installs Kyma on a running Kubernetes cluster.
* [kyma provision](kyma_provision.md) - Provisions a cluster for installation
* [kyma test](kyma_test.md) - Run tests on a provisioned Kyma cluster
* [kyma uninstall](kyma_uninstall.md) - Uninstalls Kyma from a running Kubernetes cluster
* [kyma version](kyma_version.md) - Version of the Kyma CLI and connected Kyma cluster

###### Auto generated by spf13/cobra on 3-Sep-2019
41 changes: 41 additions & 0 deletions docs/gen-docs/kyma_completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## kyma completion

Generates bash completion scripts

### Synopsis

Output shell completion code for bash. The shell code must be evaluated to provide
interactive completion of commands. This can be done by sourcing it from the .bash _profile.
To load completion, run:

. <(kyma completion)

To configure your bash shell to load completions for each session, add to your bashrc:

# ~/.bashrc or ~/.profile
. <(kyma completion)


```
kyma completion [flags]
```

### Options

```
-h, --help help for completion
```

### Options inherited from parent commands

```
--kubeconfig string Path to kubeconfig (default "/Users/i504462/.kube/config")
--non-interactive Do not use spinners
-v, --verbose verbose output
```

### SEE ALSO

* [kyma](kyma.md) - Controls a Kyma cluster.

###### Auto generated by spf13/cobra on 3-Sep-2019
31 changes: 31 additions & 0 deletions docs/gen-docs/kyma_console.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## kyma console

Open the Kyma console in a web browser

### Synopsis

Open the Kyma console in a web browser

```
kyma console [flags]
```

### Options

```
-h, --help help for console
```

### Options inherited from parent commands

```
--kubeconfig string Path to kubeconfig (default "/Users/i504462/.kube/config")
--non-interactive Do not use spinners
-v, --verbose verbose output
```

### SEE ALSO

* [kyma](kyma.md) - Controls a Kyma cluster.

###### Auto generated by spf13/cobra on 3-Sep-2019
43 changes: 43 additions & 0 deletions docs/gen-docs/kyma_install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## kyma install

Installs Kyma on a running Kubernetes cluster.

### Synopsis

Installs Kyma on a running Kubernetes cluster. For more information on the command, see https://github.com/kyma-project/cli/tree/master/pkg/kyma/docs/install.md.




```
kyma install [flags]
```

### Options

```
-d, --domain string Domain used for installation (default "kyma.local")
-h, --help help for install
-n, --noWait Do not wait for the Kyma installation to complete
-o, --override []string Path to yaml file with parameters to override. Multiple entries of this flag are allowed (default [])
-p, --password string Predefined cluster password
-s, --source string Installation source
--src-path string Path to local sources
--timeout duration Time-out after which CLI stops watching the installation progress (default 30m0s)
--tlsCert string TLS certificate for the domain used for installation
--tlsKey string TLS key for the domain used for installation
```

### Options inherited from parent commands

```
--kubeconfig string Path to kubeconfig (default "/Users/i504462/.kube/config")
--non-interactive Do not use spinners
-v, --verbose verbose output
```

### SEE ALSO

* [kyma](kyma.md) - Controls a Kyma cluster.

###### Auto generated by spf13/cobra on 3-Sep-2019
28 changes: 28 additions & 0 deletions docs/gen-docs/kyma_provision.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## kyma provision

Provisions a cluster for installation

### Synopsis

Provisions a cluster for installation

### Options

```
-h, --help help for provision
```

### Options inherited from parent commands

```
--kubeconfig string Path to kubeconfig (default "/Users/i504462/.kube/config")
--non-interactive Do not use spinners
-v, --verbose verbose output
```

### SEE ALSO

* [kyma](kyma.md) - Controls a Kyma cluster.
* [kyma provision minikube](kyma_provision_minikube.md) - Provisions Minikube

###### Auto generated by spf13/cobra on 3-Sep-2019
36 changes: 36 additions & 0 deletions docs/gen-docs/kyma_provision_minikube.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## kyma provision minikube

Provisions Minikube

### Synopsis

Provisions Minikube for Kyma installation

```
kyma provision minikube [flags]
```

### Options

```
--cpus string CPUs to use (default "4")
--disk-size string Disk size to use (default "30g")
-h, --help help for minikube
--hypervVirtualSwitch string Name of the hyperv switch, required if --vm-driver=hyperv
--memory string Memory to use (default "8192")
--vm-driver string VMDriver to use. Possible values: virtualbox,vmwarefusion,kvm,xhyve,hyperv,hyperkit,kvm2,none (default "hyperkit")
```

### Options inherited from parent commands

```
--kubeconfig string Path to kubeconfig (default "/Users/i504462/.kube/config")
--non-interactive Do not use spinners
-v, --verbose verbose output
```

### SEE ALSO

* [kyma provision](kyma_provision.md) - Provisions a cluster for installation

###### Auto generated by spf13/cobra on 3-Sep-2019
32 changes: 32 additions & 0 deletions docs/gen-docs/kyma_test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## kyma test

Run tests on a provisioned Kyma cluster

### Synopsis

Run tests on a provisioned Kyma cluster

### Options

```
-h, --help help for test
```

### Options inherited from parent commands

```
--kubeconfig string Path to kubeconfig (default "/Users/i504462/.kube/config")
--non-interactive Do not use spinners
-v, --verbose verbose output
```

### SEE ALSO

* [kyma](kyma.md) - Controls a Kyma cluster.
* [kyma test definitions](kyma_test_definitions.md) - Shows test definitions available for a provisioned Kyma cluster
* [kyma test delete](kyma_test_delete.md) - Deletes test suites available for a provisioned Kyma cluster.
* [kyma test list](kyma_test_list.md) - Lists test suites available for a provisioned Kyma cluster.
* [kyma test run](kyma_test_run.md) - Runs tests on a Kyma cluster
* [kyma test status](kyma_test_status.md) - Shows the status of a test suite and it's related test executions

###### Auto generated by spf13/cobra on 3-Sep-2019
31 changes: 31 additions & 0 deletions docs/gen-docs/kyma_test_definitions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## kyma test definitions

Shows test definitions available for a provisioned Kyma cluster

### Synopsis

Shows test definitions available for a provisioned Kyma cluster

```
kyma test definitions [flags]
```

### Options

```
-h, --help help for definitions
```

### Options inherited from parent commands

```
--kubeconfig string Path to kubeconfig (default "/Users/i504462/.kube/config")
--non-interactive Do not use spinners
-v, --verbose verbose output
```

### SEE ALSO

* [kyma test](kyma_test.md) - Run tests on a provisioned Kyma cluster

###### Auto generated by spf13/cobra on 3-Sep-2019
Loading

0 comments on commit 15ff179

Please sign in to comment.