Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify flags #28

Merged
merged 2 commits into from
Jul 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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