pipeline

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitRepo

type GitRepo struct {
	URL    string
	Branch string
}

GitRepo represents a git repository

func FindGit

func FindGit(jenkinsfile string) (repos []GitRepo, err error)

FindGit finds the git repositories from a JSON format Jenkinsfile

type GitRepos

type GitRepos []GitRepo

GitRepos is the alias of GitRepo slice

func (GitRepos) GetBranchesAsJSONString

func (g GitRepos) GetBranchesAsJSONString() (result string)

GetBranchesAsJSONString returns the branches as JSON string

For example: ["master","fea-.*"]

func (GitRepos) GetURLs

func (g GitRepos) GetURLs() string

GetURLs returns the git repository URLs as string

type Jenkinsfile

type Jenkinsfile struct {
	Pipeline Pipeline `json:"pipeline"`
}

Jenkinsfile represents a structured Jenkinsfile

We could marshal or unmarshal the JSON format Jenkinsfile

type Pipeline

type Pipeline struct {
	Stages []Stage `json:"stages"`
}

Pipeline represents a Pipeline

type Stage

type Stage struct {
	Name     string        `json:"name"`
	Branches []StageBranch `json:"branches"`
}

Stage represents a stage in a Jenkinsfile

func (Stage) GetStep

func (s Stage) GetStep(name string) (step *Step)

GetStep finds step by name

type StageBranch

type StageBranch struct {
	Name  string `json:"name"`
	Steps []Step `json:"steps"`
}

StageBranch contains the steps

type Step

type Step struct {
	Name      string         `json:"name"`
	Arguments []StepArgument `json:"arguments"`
}

Step represents a step of the a Pipeline

func (Step) GetArgument

func (s Step) GetArgument(name string) (arg *StepArgument)

GetArgument finds the argument by name

type StepArgument

type StepArgument struct {
	Key   string            `json:"key"`
	Value StepArgumentValue `json:"value"`
}

StepArgument represents a step argument

type StepArgumentValue

type StepArgumentValue struct {
	IsLiteral bool        `json:"isLiteral"`
	Value     interface{} `json:"value"`
}

StepArgumentValue represents the value of a step argument

Jump to

Keyboard shortcuts

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