forked from vmware-archive/fly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validate_pipeline.go
22 lines (17 loc) · 1.16 KB
/
validate_pipeline.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package commands
import (
"github.com/concourse/atc"
"github.com/concourse/fly/commands/internal/flaghelpers"
"github.com/concourse/fly/commands/internal/setpipelinehelpers"
)
type ValidatePipelineCommand struct {
Config atc.PathFlag `short:"c" long:"config" required:"true" description:"Pipeline configuration file"`
Strict bool `short:"s" long:"strict" description:"Fail on warnings"`
Var []flaghelpers.VariablePairFlag `short:"v" long:"var" value-name:"[NAME=STRING]" description:"Specify a string value to set for a variable in the pipeline"`
YAMLVar []flaghelpers.YAMLVariablePairFlag `short:"y" long:"yaml-var" value-name:"[NAME=YAML]" description:"Specify a YAML value to set for a variable in the pipeline"`
VarsFrom []atc.PathFlag `short:"l" long:"load-vars-from" description:"Variable flag that can be used for filling in template values in configuration from a YAML file"`
}
func (command *ValidatePipelineCommand) Execute(args []string) error {
atcConfig := setpipelinehelpers.ATCConfig{}
return atcConfig.Validate(command.Config, command.Var, command.YAMLVar, command.VarsFrom, command.Strict)
}