mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-27 19:00:35 +00:00
Merge pull request #746 from shawnzhu/inject-params
parse build file with params injection
This commit is contained in:
commit
5539f63ba5
2 changed files with 3 additions and 3 deletions
|
@ -115,7 +115,7 @@ func run(path, identity, dockerhost, dockercert, dockerkey string, publish, depl
|
|||
envs := getParamMap("DRONE_ENV_")
|
||||
|
||||
// parse the Drone yml file
|
||||
s, err := script.ParseBuildFile(script.Inject(path, envs))
|
||||
s, err := script.ParseBuildFile(path, envs)
|
||||
if err != nil {
|
||||
log.Err(err.Error())
|
||||
return EXIT_STATUS, err
|
||||
|
|
|
@ -22,13 +22,13 @@ func ParseBuild(data string) (*Build, error) {
|
|||
return &build, err
|
||||
}
|
||||
|
||||
func ParseBuildFile(filename string) (*Build, error) {
|
||||
func ParseBuildFile(filename string, params map[string]string) (*Build, error) {
|
||||
data, err := ioutil.ReadFile(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return ParseBuild(string(data))
|
||||
return ParseBuild(Inject(string(data), params))
|
||||
}
|
||||
|
||||
// Build stores the configuration details for
|
||||
|
|
Loading…
Reference in a new issue