Initialize Steps with a NewSTEPNAME function [#67]
This seems to be be a more natural separation of concerns--the knowledge of which config fields map to which parts of a Step belong to the Step, not to the Plan.
This commit is contained in:
@@ -2,6 +2,7 @@ package run
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/pelotech/drone-helm3/internal/env"
|
||||
)
|
||||
|
||||
// Help is a step in a helm Plan that calls `helm help`.
|
||||
@@ -10,6 +11,13 @@ type Help struct {
|
||||
cmd cmd
|
||||
}
|
||||
|
||||
// NewHelp creates a Help using fields from the given Config. No validation is performed at this time.
|
||||
func NewHelp(cfg env.Config) *Help {
|
||||
return &Help{
|
||||
HelmCommand: cfg.Command,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the `helm help` command.
|
||||
func (h *Help) Execute(cfg Config) error {
|
||||
if err := h.cmd.Run(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user