mirror of
https://github.com/appleboy/drone-jenkins.git
synced 2026-06-04 18:23:57 +08:00
fix: show error if missing jobs.
This commit is contained in:
@@ -36,13 +36,20 @@ func (p Plugin) Exec() error {
|
||||
return errors.New("missing jenkins config")
|
||||
}
|
||||
|
||||
jobs := trimElement(p.Job)
|
||||
|
||||
if len(jobs) == 0 {
|
||||
return errors.New("missing jenkins job")
|
||||
}
|
||||
|
||||
auth := &Auth{
|
||||
Username: p.Username,
|
||||
Token: p.Token,
|
||||
}
|
||||
|
||||
jenkins := NewJenkins(auth, p.BaseURL)
|
||||
|
||||
for _, value := range trimElement(p.Job) {
|
||||
for _, value := range jobs {
|
||||
jenkins.trigger(value, nil)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user