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"
|
||||
)
|
||||
|
||||
// DepUpdate is an execution step that calls `helm dependency update` when executed.
|
||||
@@ -10,6 +11,13 @@ type DepUpdate struct {
|
||||
cmd cmd
|
||||
}
|
||||
|
||||
// NewDepUpdate creates a DepUpdate using fields from the given Config. No validation is performed at this time.
|
||||
func NewDepUpdate(cfg env.Config) *DepUpdate {
|
||||
return &DepUpdate{
|
||||
Chart: cfg.Chart,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the `helm upgrade` command.
|
||||
func (d *DepUpdate) Execute(_ Config) error {
|
||||
return d.cmd.Run()
|
||||
|
||||
Reference in New Issue
Block a user