Skip to content

Commit 9694015

Browse files
Expose deploy history subcommand
1 parent 33ede09 commit 9694015

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

cmd/deploy_history.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/aryansharma9917/codewise-cli/pkg/deploy"
7+
"github.com/spf13/cobra"
8+
)
9+
10+
var historyEnv string
11+
12+
var deployHistoryCmd = &cobra.Command{
13+
Use: "history",
14+
Short: "Show Helm release history for an environment",
15+
RunE: func(cmd *cobra.Command, args []string) error {
16+
17+
if historyEnv == "" {
18+
return fmt.Errorf("please provide --env")
19+
}
20+
21+
return deploy.History(historyEnv)
22+
},
23+
}
24+
25+
func init() {
26+
deployCmd.AddCommand(deployHistoryCmd)
27+
deployHistoryCmd.Flags().StringVar(&historyEnv, "env", "", "Environment name")
28+
}

0 commit comments

Comments
 (0)