Skip to content

Commit

Permalink
simplify flags (#28)
Browse files Browse the repository at this point in the history
* removed "install-" flag prefixes
* added install/uninstall info messages
  • Loading branch information
ATGardner authored Jul 25, 2021
1 parent 46a7c5d commit 0817f17
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=v0.0.33
VERSION=v0.0.34
OUT_DIR=dist
YEAR?=$(shell date +"%Y")

Expand Down
12 changes: 10 additions & 2 deletions cmd/commands/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ func NewRuntimeInstallCommand() *cobra.Command {

cmd.Flags().StringVar(&versionStr, "version", "", "The runtime version to install, defaults to latest")
insCloneOpts = git.AddFlags(cmd, &git.AddFlagsOptions{
Prefix: "install",
CreateIfNotExist: true,
FS: memfs.New(),
})
Expand All @@ -178,6 +177,7 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
return fmt.Errorf("failed to download runtime definition: %w", err)
}

log.G(ctx).WithField("version", rt.Spec.Version).Infof("installing runtime '%s'", opts.RuntimeName)
err = apcmd.RunRepoBootstrap(ctx, &apcmd.RepoBootstrapOptions{
AppSpecifier: rt.Spec.FullSpecifier(),
Namespace: opts.RuntimeName,
Expand Down Expand Up @@ -219,6 +219,7 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
return fmt.Errorf("failed to create `%s`: %w", store.Get().GitSourceName, err)
}

log.G(ctx).Infof("done installing runtime '%s'", opts.RuntimeName)
return nil
}

Expand Down Expand Up @@ -332,12 +333,19 @@ func NewRuntimeUninsatllCommand() *cobra.Command {
}

func RunRuntimeUninstall(ctx context.Context, opts *RuntimeUninstallOptions) error {
return apcmd.RunRepoUninstall(ctx, &apcmd.RepoUninstallOptions{
log.G(ctx).Infof("uninstalling runtime '%s'", opts.RuntimeName)
err := apcmd.RunRepoUninstall(ctx, &apcmd.RepoUninstallOptions{
Namespace: opts.RuntimeName,
Timeout: opts.Timeout,
CloneOptions: opts.CloneOpts,
KubeFactory: opts.KubeFactory,
})
if err != nil {
return fmt.Errorf("failed uninstalling runtime: %w", err)
}

log.G(ctx).Infof("done uninstalling runtime '%s'", opts.RuntimeName)
return nil
}

func NewRuntimeUpgradeCommand() *cobra.Command {
Expand Down
6 changes: 3 additions & 3 deletions docs/commands/cli-v2_runtime_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ cli-v2 runtime install [runtime_name] [flags]
--git-src-git-token string Your git provider api token [GIT_SRC_GIT_TOKEN]
--git-src-provider string The git provider, one of: gitea|github
--git-src-repo string Repository URL [GIT_SRC_GIT_REPO]
-t, --git-token string Your git provider api token [GIT_TOKEN]
-h, --help help for install
--install-git-token string Your git provider api token [INSTALL_GIT_TOKEN]
--install-provider string The git provider, one of: gitea|github
--install-repo string Repository URL [INSTALL_GIT_REPO]
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
-n, --namespace string If present, the namespace scope for this CLI request
--provider string The git provider, one of: gitea|github
--repo string Repository URL [GIT_REPO]
--version string The runtime version to install, defaults to latest
```

Expand Down
4 changes: 2 additions & 2 deletions docs/releases/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
### Linux
```bash
# download and extract the binary
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.32/cf-linux-amd64.tar.gz | tar zx
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.34/cf-linux-amd64.tar.gz | tar zx

# move the binary to your $PATH
mv ./cf-linux-amd64 /usr/local/bin/cf
Expand All @@ -20,7 +20,7 @@ cf version
### Mac
```bash
# download and extract the binary
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.32/cf-darwin-amd64.tar.gz | tar zx
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.34/cf-darwin-amd64.tar.gz | tar zx

# move the binary to your $PATH
mv ./cf-darwin-amd64 /usr/local/bin/cf
Expand Down
2 changes: 1 addition & 1 deletion manifests/runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: "{{ namespace }}"
spec:
defVersion: 1.0.0
version: 0.0.32
version: 0.0.34
bootstrapSpecifier: github.com/codefresh-io/cli-v2/manifests/argo-cd
components:
- name: events
Expand Down

0 comments on commit 0817f17

Please sign in to comment.