-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add command docs and job to check it (#211)
* add command docs Signed-off-by: cpanato <ctadeu@gmail.com> * add job to check command doc Signed-off-by: cpanato <ctadeu@gmail.com> * avoid dynamic docs and expand the path later Signed-off-by: cpanato <ctadeu@gmail.com> Signed-off-by: cpanato <ctadeu@gmail.com>
- Loading branch information
Showing
17 changed files
with
470 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ chart-releaser | |
/dist | ||
/vendor | ||
.vscode | ||
/cr-bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright The Helm Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/MakeNowJust/heredoc" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/cobra/doc" | ||
) | ||
|
||
var generateDocsCmd = &cobra.Command{ | ||
Use: "doc-gen", | ||
Short: "Generate documentation", | ||
Long: heredoc.Doc(` | ||
Generate documentation for all commands | ||
to the 'docs' directory.`), | ||
Hidden: true, | ||
RunE: generateDocs, | ||
} | ||
|
||
func generateDocs(cmd *cobra.Command, args []string) error { | ||
fmt.Println("Generating docs...") | ||
|
||
err := doc.GenMarkdownTree(rootCmd.Root(), "doc") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
fmt.Println("Done.") | ||
return nil | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(generateDocsCmd) | ||
|
||
rootCmd.DisableAutoGenTag = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## cr | ||
|
||
Helm Chart Repos on Github Pages | ||
|
||
### Synopsis | ||
|
||
|
||
Create Helm chart repositories on GitHub Pages by uploading Chart packages | ||
and Chart metadata to GitHub Releases and creating a suitable index file | ||
|
||
|
||
### Options | ||
|
||
``` | ||
--config string Config file (default is $HOME/.cr.yaml) | ||
-h, --help help for cr | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [cr completion](cr_completion.md) - Generate the autocompletion script for the specified shell | ||
* [cr index](cr_index.md) - Update Helm repo index.yaml for the given GitHub repo | ||
* [cr package](cr_package.md) - Package Helm charts | ||
* [cr upload](cr_upload.md) - Upload Helm chart packages to GitHub Releases | ||
* [cr version](cr_version.md) - Print version information | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## cr completion | ||
|
||
Generate the autocompletion script for the specified shell | ||
|
||
### Synopsis | ||
|
||
Generate the autocompletion script for cr for the specified shell. | ||
See each sub-command's help for details on how to use the generated script. | ||
|
||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for completion | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string Config file (default is $HOME/.cr.yaml) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [cr](cr.md) - Helm Chart Repos on Github Pages | ||
* [cr completion bash](cr_completion_bash.md) - Generate the autocompletion script for bash | ||
* [cr completion fish](cr_completion_fish.md) - Generate the autocompletion script for fish | ||
* [cr completion powershell](cr_completion_powershell.md) - Generate the autocompletion script for powershell | ||
* [cr completion zsh](cr_completion_zsh.md) - Generate the autocompletion script for zsh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
## cr completion bash | ||
|
||
Generate the autocompletion script for bash | ||
|
||
### Synopsis | ||
|
||
Generate the autocompletion script for the bash shell. | ||
|
||
This script depends on the 'bash-completion' package. | ||
If it is not installed already, you can install it via your OS's package manager. | ||
|
||
To load completions in your current shell session: | ||
|
||
source <(cr completion bash) | ||
|
||
To load completions for every new session, execute once: | ||
|
||
#### Linux: | ||
|
||
cr completion bash > /etc/bash_completion.d/cr | ||
|
||
#### macOS: | ||
|
||
cr completion bash > $(brew --prefix)/etc/bash_completion.d/cr | ||
|
||
You will need to start a new shell for this setup to take effect. | ||
|
||
|
||
``` | ||
cr completion bash | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for bash | ||
--no-descriptions disable completion descriptions | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string Config file (default is $HOME/.cr.yaml) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [cr completion](cr_completion.md) - Generate the autocompletion script for the specified shell | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
## cr completion fish | ||
|
||
Generate the autocompletion script for fish | ||
|
||
### Synopsis | ||
|
||
Generate the autocompletion script for the fish shell. | ||
|
||
To load completions in your current shell session: | ||
|
||
cr completion fish | source | ||
|
||
To load completions for every new session, execute once: | ||
|
||
cr completion fish > ~/.config/fish/completions/cr.fish | ||
|
||
You will need to start a new shell for this setup to take effect. | ||
|
||
|
||
``` | ||
cr completion fish [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for fish | ||
--no-descriptions disable completion descriptions | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string Config file (default is $HOME/.cr.yaml) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [cr completion](cr_completion.md) - Generate the autocompletion script for the specified shell | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## cr completion powershell | ||
|
||
Generate the autocompletion script for powershell | ||
|
||
### Synopsis | ||
|
||
Generate the autocompletion script for powershell. | ||
|
||
To load completions in your current shell session: | ||
|
||
cr completion powershell | Out-String | Invoke-Expression | ||
|
||
To load completions for every new session, add the output of the above command | ||
to your powershell profile. | ||
|
||
|
||
``` | ||
cr completion powershell [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for powershell | ||
--no-descriptions disable completion descriptions | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string Config file (default is $HOME/.cr.yaml) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [cr completion](cr_completion.md) - Generate the autocompletion script for the specified shell | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
## cr completion zsh | ||
|
||
Generate the autocompletion script for zsh | ||
|
||
### Synopsis | ||
|
||
Generate the autocompletion script for the zsh shell. | ||
|
||
If shell completion is not already enabled in your environment you will need | ||
to enable it. You can execute the following once: | ||
|
||
echo "autoload -U compinit; compinit" >> ~/.zshrc | ||
|
||
To load completions in your current shell session: | ||
|
||
source <(cr completion zsh); compdef _cr cr | ||
|
||
To load completions for every new session, execute once: | ||
|
||
#### Linux: | ||
|
||
cr completion zsh > "${fpath[1]}/_cr" | ||
|
||
#### macOS: | ||
|
||
cr completion zsh > $(brew --prefix)/share/zsh/site-functions/_cr | ||
|
||
You will need to start a new shell for this setup to take effect. | ||
|
||
|
||
``` | ||
cr completion zsh [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for zsh | ||
--no-descriptions disable completion descriptions | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string Config file (default is $HOME/.cr.yaml) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [cr completion](cr_completion.md) - Generate the autocompletion script for the specified shell | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
## cr index | ||
|
||
Update Helm repo index.yaml for the given GitHub repo | ||
|
||
### Synopsis | ||
|
||
|
||
Update a Helm chart repository index.yaml file based on a the | ||
given GitHub repository's releases. | ||
|
||
|
||
``` | ||
cr index [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-b, --git-base-url string GitHub Base URL (only needed for private GitHub) (default "https://api.github.com/") | ||
-r, --git-repo string GitHub repository | ||
-u, --git-upload-url string GitHub Upload URL (only needed for private GitHub) (default "https://uploads.github.com/") | ||
-h, --help help for index | ||
-i, --index-path string Path to index file (default ".cr-index/index.yaml") | ||
-o, --owner string GitHub username or organization | ||
-p, --package-path string Path to directory with chart packages (default ".cr-release-packages") | ||
--pages-branch string The GitHub pages branch (default "gh-pages") | ||
--pages-index-path string The GitHub pages index path (default "index.yaml") | ||
--pr Create a pull request for index.yaml against the GitHub Pages branch (must not be set if --push is set) | ||
--push Push index.yaml to the GitHub Pages branch (must not be set if --pr is set) | ||
--release-name-template string Go template for computing release names, using chart metadata (default "{{ .Name }}-{{ .Version }}") | ||
--remote string The Git remote used when creating a local worktree for the GitHub Pages branch (default "origin") | ||
-t, --token string GitHub Auth Token (only needed for private repos) | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string Config file (default is $HOME/.cr.yaml) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [cr](cr.md) - Helm Chart Repos on Github Pages | ||
|
Oops, something went wrong.