mirror of
https://github.com/appleboy/drone-jenkins.git
synced 2026-06-04 18:23:57 +08:00
feat: add remote trigger token support for Jenkins job execution
- Add support for passing a remote trigger token to Jenkins jobs - Update the Jenkins constructor to accept a token parameter - Ensure the token is included as a query parameter when triggering jobs - Improve error reporting by including response body in error messages - Remove unnecessary logging and refactor build parameter logic - Update tests to use the new Jenkins constructor and token handling - Add CLI option for specifying a remote trigger token - Extend plugin configuration to support remote token injection Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -10,12 +10,13 @@ import (
|
||||
type (
|
||||
// Plugin values.
|
||||
Plugin struct {
|
||||
BaseURL string
|
||||
Username string
|
||||
Token string
|
||||
Job []string
|
||||
Insecure bool
|
||||
Parameters []string
|
||||
BaseURL string
|
||||
Username string
|
||||
Token string
|
||||
RemoteToken string
|
||||
Job []string
|
||||
Insecure bool
|
||||
Parameters []string
|
||||
}
|
||||
)
|
||||
|
||||
@@ -50,7 +51,7 @@ func (p Plugin) Exec() error {
|
||||
Token: p.Token,
|
||||
}
|
||||
|
||||
jenkins := NewJenkins(auth, p.BaseURL, p.Insecure)
|
||||
jenkins := NewJenkins(auth, p.BaseURL, p.RemoteToken, p.Insecure)
|
||||
|
||||
params := url.Values{}
|
||||
for _, v := range p.Parameters {
|
||||
|
||||
Reference in New Issue
Block a user