jenkins

package
v3.81.6 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type JenkinsBuild

type JenkinsBuild struct {
	Number int64  `json:"number"`
	Url    string `json:"url"`
}

type JenkinsBuildResponse

type JenkinsBuildResponse struct {
	Builds []JenkinsBuild `json:"builds"`
}

type JenkinsJobResponse

type JenkinsJobResponse struct {
	Jobs []struct {
		Class string `json:"_class"`
		Name  string `json:"name"`
		Url   string `json:"url"`
	} `json:"jobs"`
}

type Source

type Source struct {
	sources.Progress
	// contains filtered or unexported fields
}

func (*Source) Chunks

func (s *Source) Chunks(ctx context.Context, chunksChan chan *sources.Chunk, _ ...sources.ChunkingTarget) error

Chunks emits chunks of bytes over a channel.

func (*Source) GetJenkinsBuilds

func (s *Source) GetJenkinsBuilds(ctx context.Context, jobAbsolutePath string) (JenkinsBuildResponse, error)

func (*Source) GetJenkinsJobs

func (s *Source) GetJenkinsJobs(ctx context.Context) (JenkinsJobResponse, error)

GetJenkinsJobs traverses the tree to find all jobs. Example response from http://localhost:8080/api/json?tree=jobs[name,url]{0,100} on our Jenkins instance:

{
	"_class": "hudson.model.Hudson",
	"jobs": [
	  {
		"_class": "com.cloudbees.hudson.plugins.folder.Folder",
		"name": "folder1",
		"url": "http://jenkins:8080/job/folder1/"
	  },
	  {
		"_class": "org.jenkinsci.plugins.workflow.job.WorkflowJob",
		"name": "hon-test",
		"url": "http://jenkins:8080/job/hon-test/"
	  },
	  {
		"_class": "hudson.model.FreeStyleProject",
		"name": "hon-test-project",
		"url": "http://jenkins:8080/job/hon-test-project/"
	  },
	  {
		"_class": "hudson.model.FreeStyleProject",
		"name": "steeeve-freestyle-project",
		"url": "http://jenkins:8080/job/steeeve-freestyle-project/"
	  }
	]
}

func (*Source) GetJenkinsObjectsForPath

func (s *Source) GetJenkinsObjectsForPath(ctx context.Context, absolutePath string) (JenkinsJobResponse, error)

func (*Source) Init

func (s *Source) Init(aCtx context.Context, name string, jobId sources.JobID, sourceId sources.SourceID, verify bool, connection *anypb.Any, _ int) error

Init returns an initialized Jenkins source.

func (*Source) JobID

func (s *Source) JobID() sources.JobID

func (*Source) NewRequest

func (s *Source) NewRequest(method, url string, body io.Reader) (*http.Request, error)

func (*Source) RecursivelyGetJenkinsObjectsForPath

func (s *Source) RecursivelyGetJenkinsObjectsForPath(ctx context.Context, absolutePath string) (JenkinsJobResponse, error)

func (*Source) SourceID

func (s *Source) SourceID() sources.SourceID

func (*Source) Type

func (s *Source) Type() sourcespb.SourceType

Type returns the type of source. It is used for matching source types in configuration and job input.

Jump to

Keyboard shortcuts

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