jenkins_provider

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

Jenkins plugin

You can communicate with jenkins server with this plugin

plugin config

provider:
  jenkins:
    plugin: jenkins # name of the plugin
    config: # configuration
      server_url: http://localhost:8080 # jenkins server url
      username: admin   # jenkins server username
      password: admin   # jenkins server password or token
      insecure: false   # allow insecure login (example: jenkins server with ssl certificate)
      timeout: 1h       # default timeout

provider template configuration

function: build # name of the function
config: # configuration details
  wait_for_completion: true # waits till the job completes
  retry_count: 2 # number of retry count, if the job failed
  timeout: 30m # overrides the default timeout
data:   # data used to run the function
  - job_name: abc
    limit: 5
    parameters:
      ABC: XYZ
      ACC: QWE 
Function - build

build function creates a jenkins build on a specified jenkins job with the given parameters.

  • if wait_for_completion is false, returns immediately
  • retry_count: number of retry, if the job failed
  • timeout: fail the task immediately, if it reaches the timeout duration
function: build
config:
  wait_for_completion: true
  retry_count: 2
  timeout: 30m
data:
  - job_name: abc # job name
    limit: 5  # limit the results, used to filter by queue id
    parameters: # parameters used to build a job
      ABC: XYZ
      ACC: QWE 

Documentation

Index

Constants

View Source
const (
	PluginName = "jenkins"
)

Variables

This section is empty.

Functions

func New

func New(config map[string]interface{}) (providerPluginTY.Plugin, error)

Types

type Jenkins

type Jenkins struct {
	Config jenkinsProviderTY.PluginConfig
	Client *jenkins.Client
}

func (*Jenkins) Close

func (j *Jenkins) Close() error

func (*Jenkins) Execute

func (j *Jenkins) Execute(task *templateTY.Task) (interface{}, error)

func (*Jenkins) Name

func (j *Jenkins) Name() string

func (*Jenkins) Start

func (j *Jenkins) Start() error

Start loads jenkins client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL