Skip to content

Commit

Permalink
Merge pull request #221 from figo/master
Browse files Browse the repository at this point in the history
BuildJob accept map as argument rather than a slice
  • Loading branch information
figo authored Jan 12, 2021
2 parents 980672b + 27e7500 commit ab81397
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if err != nil {
panic("Something Went Wrong")
}

queueid, err := jenkins.BuildJob(ctx, "#jobname")
queueid, err := jenkins.BuildJob(ctx, "#jobname", nil)
if err != nil {
panic(err)
}
Expand Down
6 changes: 1 addition & 5 deletions jenkins.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,8 @@ func (j *Jenkins) DeleteJob(ctx context.Context, name string) (bool, error) {
// Invoke a job.
// First parameter job name, second parameter is optional Build parameters.
// Returns queue id
func (j *Jenkins) BuildJob(ctx context.Context, name string, options ...interface{}) (int64, error) {
func (j *Jenkins) BuildJob(ctx context.Context, name string, params map[string]string) (int64, error) {
job := Job{Jenkins: j, Raw: new(JobResponse), Base: "/job/" + name}
var params map[string]string
if len(options) > 0 {
params, _ = options[0].(map[string]string)
}
return job.InvokeSimple(ctx, params)
}

Expand Down

0 comments on commit ab81397

Please sign in to comment.