Documentation ¶
Index ¶
- type AzureDevOpsConfigProvider
- func (a *AzureDevOpsConfigProvider) GetBranch() string
- func (a *AzureDevOpsConfigProvider) GetBuildID() string
- func (a *AzureDevOpsConfigProvider) GetBuildReason() string
- func (a *AzureDevOpsConfigProvider) GetBuildStatus() string
- func (a *AzureDevOpsConfigProvider) GetBuildURL() string
- func (a *AzureDevOpsConfigProvider) GetCommit() string
- func (a *AzureDevOpsConfigProvider) GetJobName() string
- func (a *AzureDevOpsConfigProvider) GetJobURL() string
- func (a *AzureDevOpsConfigProvider) GetLog() ([]byte, error)
- func (a *AzureDevOpsConfigProvider) GetPipelineStartTime() time.Time
- func (a *AzureDevOpsConfigProvider) GetPullRequestConfig() PullRequestConfig
- func (a *AzureDevOpsConfigProvider) GetRepoURL() string
- func (a *AzureDevOpsConfigProvider) GetStageName() string
- func (a *AzureDevOpsConfigProvider) InitOrchestratorProvider(settings *OrchestratorSettings)
- func (a *AzureDevOpsConfigProvider) IsPullRequest() bool
- func (a *AzureDevOpsConfigProvider) OrchestratorType() string
- func (a *AzureDevOpsConfigProvider) OrchestratorVersion() string
- type GitHubActionsConfigProvider
- func (g *GitHubActionsConfigProvider) GetBranch() string
- func (g *GitHubActionsConfigProvider) GetBuildID() string
- func (g *GitHubActionsConfigProvider) GetBuildReason() string
- func (g *GitHubActionsConfigProvider) GetBuildStatus() string
- func (g *GitHubActionsConfigProvider) GetBuildURL() string
- func (g *GitHubActionsConfigProvider) GetCommit() string
- func (g *GitHubActionsConfigProvider) GetJobName() string
- func (g *GitHubActionsConfigProvider) GetJobURL() string
- func (g *GitHubActionsConfigProvider) GetLog() ([]byte, error)
- func (g *GitHubActionsConfigProvider) GetPipelineStartTime() time.Time
- func (g *GitHubActionsConfigProvider) GetPullRequestConfig() PullRequestConfig
- func (g *GitHubActionsConfigProvider) GetRepoURL() string
- func (g *GitHubActionsConfigProvider) GetStageName() string
- func (g *GitHubActionsConfigProvider) InitOrchestratorProvider(settings *OrchestratorSettings)
- func (g *GitHubActionsConfigProvider) IsPullRequest() bool
- func (g *GitHubActionsConfigProvider) OrchestratorType() string
- func (g *GitHubActionsConfigProvider) OrchestratorVersion() string
- type JenkinsConfigProvider
- func (j *JenkinsConfigProvider) GetBranch() string
- func (j *JenkinsConfigProvider) GetBuildID() string
- func (j *JenkinsConfigProvider) GetBuildReason() string
- func (j *JenkinsConfigProvider) GetBuildStatus() string
- func (j *JenkinsConfigProvider) GetBuildURL() string
- func (j *JenkinsConfigProvider) GetCommit() string
- func (j *JenkinsConfigProvider) GetJobName() string
- func (j *JenkinsConfigProvider) GetJobURL() string
- func (j *JenkinsConfigProvider) GetLog() ([]byte, error)
- func (j *JenkinsConfigProvider) GetPipelineStartTime() time.Time
- func (j *JenkinsConfigProvider) GetPullRequestConfig() PullRequestConfig
- func (j *JenkinsConfigProvider) GetRepoURL() string
- func (j *JenkinsConfigProvider) GetStageName() string
- func (j *JenkinsConfigProvider) InitOrchestratorProvider(settings *OrchestratorSettings)
- func (j *JenkinsConfigProvider) IsPullRequest() bool
- func (j *JenkinsConfigProvider) OrchestratorType() string
- func (j *JenkinsConfigProvider) OrchestratorVersion() string
- type Orchestrator
- type OrchestratorSettings
- type OrchestratorSpecificConfigProviding
- type PullRequestConfig
- type UnknownOrchestratorConfigProvider
- func (u *UnknownOrchestratorConfigProvider) GetBranch() string
- func (u *UnknownOrchestratorConfigProvider) GetBuildID() string
- func (u *UnknownOrchestratorConfigProvider) GetBuildReason() string
- func (u *UnknownOrchestratorConfigProvider) GetBuildStatus() string
- func (u *UnknownOrchestratorConfigProvider) GetBuildURL() string
- func (u *UnknownOrchestratorConfigProvider) GetCommit() string
- func (u *UnknownOrchestratorConfigProvider) GetJobName() string
- func (u *UnknownOrchestratorConfigProvider) GetJobURL() string
- func (u *UnknownOrchestratorConfigProvider) GetLog() ([]byte, error)
- func (u *UnknownOrchestratorConfigProvider) GetPipelineStartTime() time.Time
- func (u *UnknownOrchestratorConfigProvider) GetPullRequestConfig() PullRequestConfig
- func (u *UnknownOrchestratorConfigProvider) GetRepoURL() string
- func (u *UnknownOrchestratorConfigProvider) GetStageName() string
- func (u *UnknownOrchestratorConfigProvider) InitOrchestratorProvider(settings *OrchestratorSettings)
- func (u *UnknownOrchestratorConfigProvider) IsPullRequest() bool
- func (u *UnknownOrchestratorConfigProvider) OrchestratorType() string
- func (u *UnknownOrchestratorConfigProvider) OrchestratorVersion() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureDevOpsConfigProvider ¶
type AzureDevOpsConfigProvider struct {
// contains filtered or unexported fields
}
func (*AzureDevOpsConfigProvider) GetBranch ¶
func (a *AzureDevOpsConfigProvider) GetBranch() string
GetBranch returns the source branch name, e.g. main
func (*AzureDevOpsConfigProvider) GetBuildID ¶
func (a *AzureDevOpsConfigProvider) GetBuildID() string
GetBuildID returns the BuildNumber displayed in the ADO UI
func (*AzureDevOpsConfigProvider) GetBuildReason ¶
func (a *AzureDevOpsConfigProvider) GetBuildReason() string
GetBuildReason returns the build reason
func (*AzureDevOpsConfigProvider) GetBuildStatus ¶
func (a *AzureDevOpsConfigProvider) GetBuildStatus() string
GetBuildStatus returns status of the build. Return variables are aligned with Jenkins build statuses.
func (*AzureDevOpsConfigProvider) GetBuildURL ¶
func (a *AzureDevOpsConfigProvider) GetBuildURL() string
GetBuildURL returns the builds URL e.g. https://dev.azure.com/fabrikamfiber/your-repo-name/_build/results?buildId=1234
func (*AzureDevOpsConfigProvider) GetCommit ¶
func (a *AzureDevOpsConfigProvider) GetCommit() string
GetCommit returns commit SHA of current build
func (*AzureDevOpsConfigProvider) GetJobName ¶
func (a *AzureDevOpsConfigProvider) GetJobName() string
GetJobName returns the pipeline job name, currently org/repo
func (*AzureDevOpsConfigProvider) GetJobURL ¶
func (a *AzureDevOpsConfigProvider) GetJobURL() string
GetJobURL returns tje current job url e.g. https://dev.azure.com/fabrikamfiber/your-repo-name/_build?definitionId=1234
func (*AzureDevOpsConfigProvider) GetLog ¶
func (a *AzureDevOpsConfigProvider) GetLog() ([]byte, error)
GetLog returns the whole logfile for the current pipeline run
func (*AzureDevOpsConfigProvider) GetPipelineStartTime ¶
func (a *AzureDevOpsConfigProvider) GetPipelineStartTime() time.Time
GetPipelineStartTime returns the pipeline start time in UTC
func (*AzureDevOpsConfigProvider) GetPullRequestConfig ¶
func (a *AzureDevOpsConfigProvider) GetPullRequestConfig() PullRequestConfig
GetPullRequestConfig returns pull request configuration
func (*AzureDevOpsConfigProvider) GetRepoURL ¶
func (a *AzureDevOpsConfigProvider) GetRepoURL() string
GetRepoURL returns current repo URL e.g. https://github.com/SAP/jenkins-library
func (*AzureDevOpsConfigProvider) GetStageName ¶
func (a *AzureDevOpsConfigProvider) GetStageName() string
GetStageName returns the human-readable name given to a stage. e.g. "Promote" or "Init"
func (*AzureDevOpsConfigProvider) InitOrchestratorProvider ¶
func (a *AzureDevOpsConfigProvider) InitOrchestratorProvider(settings *OrchestratorSettings)
InitOrchestratorProvider initializes http client for AzureDevopsConfigProvider
func (*AzureDevOpsConfigProvider) IsPullRequest ¶
func (a *AzureDevOpsConfigProvider) IsPullRequest() bool
IsPullRequest indicates whether the current build is a PR
func (*AzureDevOpsConfigProvider) OrchestratorType ¶
func (a *AzureDevOpsConfigProvider) OrchestratorType() string
OrchestratorType returns the orchestrator name e.g. Azure/GitHubActions/Jenkins
func (*AzureDevOpsConfigProvider) OrchestratorVersion ¶
func (a *AzureDevOpsConfigProvider) OrchestratorVersion() string
OrchestratorVersion returns the agent version on ADO
type GitHubActionsConfigProvider ¶
type GitHubActionsConfigProvider struct{}
func (*GitHubActionsConfigProvider) GetBranch ¶
func (g *GitHubActionsConfigProvider) GetBranch() string
func (*GitHubActionsConfigProvider) GetBuildID ¶
func (g *GitHubActionsConfigProvider) GetBuildID() string
func (*GitHubActionsConfigProvider) GetBuildReason ¶
func (g *GitHubActionsConfigProvider) GetBuildReason() string
func (*GitHubActionsConfigProvider) GetBuildStatus ¶
func (g *GitHubActionsConfigProvider) GetBuildStatus() string
func (*GitHubActionsConfigProvider) GetBuildURL ¶
func (g *GitHubActionsConfigProvider) GetBuildURL() string
func (*GitHubActionsConfigProvider) GetCommit ¶
func (g *GitHubActionsConfigProvider) GetCommit() string
func (*GitHubActionsConfigProvider) GetJobName ¶
func (g *GitHubActionsConfigProvider) GetJobName() string
func (*GitHubActionsConfigProvider) GetJobURL ¶
func (g *GitHubActionsConfigProvider) GetJobURL() string
func (*GitHubActionsConfigProvider) GetLog ¶
func (g *GitHubActionsConfigProvider) GetLog() ([]byte, error)
func (*GitHubActionsConfigProvider) GetPipelineStartTime ¶
func (g *GitHubActionsConfigProvider) GetPipelineStartTime() time.Time
func (*GitHubActionsConfigProvider) GetPullRequestConfig ¶
func (g *GitHubActionsConfigProvider) GetPullRequestConfig() PullRequestConfig
func (*GitHubActionsConfigProvider) GetRepoURL ¶
func (g *GitHubActionsConfigProvider) GetRepoURL() string
func (*GitHubActionsConfigProvider) GetStageName ¶
func (g *GitHubActionsConfigProvider) GetStageName() string
func (*GitHubActionsConfigProvider) InitOrchestratorProvider ¶
func (g *GitHubActionsConfigProvider) InitOrchestratorProvider(settings *OrchestratorSettings)
func (*GitHubActionsConfigProvider) IsPullRequest ¶
func (g *GitHubActionsConfigProvider) IsPullRequest() bool
func (*GitHubActionsConfigProvider) OrchestratorType ¶
func (g *GitHubActionsConfigProvider) OrchestratorType() string
func (*GitHubActionsConfigProvider) OrchestratorVersion ¶
func (g *GitHubActionsConfigProvider) OrchestratorVersion() string
type JenkinsConfigProvider ¶
type JenkinsConfigProvider struct {
// contains filtered or unexported fields
}
func (*JenkinsConfigProvider) GetBranch ¶
func (j *JenkinsConfigProvider) GetBranch() string
GetBranch returns the branch name, only works with the git plugin enabled
func (*JenkinsConfigProvider) GetBuildID ¶
func (j *JenkinsConfigProvider) GetBuildID() string
GetBuildID returns the build ID of the current job, e.g. 1234
func (*JenkinsConfigProvider) GetBuildReason ¶
func (j *JenkinsConfigProvider) GetBuildReason() string
GetBuildReason returns the build reason of the current build
func (*JenkinsConfigProvider) GetBuildStatus ¶
func (j *JenkinsConfigProvider) GetBuildStatus() string
GetBuildStatus returns build status of the current job
func (*JenkinsConfigProvider) GetBuildURL ¶
func (j *JenkinsConfigProvider) GetBuildURL() string
GetBuildURL returns the build url, e.g. https://jaas.url/job/foo/job/bar/job/main/1234/
func (*JenkinsConfigProvider) GetCommit ¶
func (j *JenkinsConfigProvider) GetCommit() string
GetCommit returns the commit SHA from the current build, only works with the git plugin enabled
func (*JenkinsConfigProvider) GetJobName ¶
func (j *JenkinsConfigProvider) GetJobName() string
GetJobName returns the job name of the current job e.g. foo/bar/BRANCH
func (*JenkinsConfigProvider) GetJobURL ¶
func (j *JenkinsConfigProvider) GetJobURL() string
GetJobURL returns the current job URL e.g. https://jaas.url/job/foo/job/bar/job/main
func (*JenkinsConfigProvider) GetLog ¶
func (j *JenkinsConfigProvider) GetLog() ([]byte, error)
GetLog returns the logfile from the current job as byte object
func (*JenkinsConfigProvider) GetPipelineStartTime ¶
func (j *JenkinsConfigProvider) GetPipelineStartTime() time.Time
GetPipelineStartTime returns the pipeline start time in UTC
func (*JenkinsConfigProvider) GetPullRequestConfig ¶
func (j *JenkinsConfigProvider) GetPullRequestConfig() PullRequestConfig
GetPullRequestConfig returns the pull request config
func (*JenkinsConfigProvider) GetRepoURL ¶
func (j *JenkinsConfigProvider) GetRepoURL() string
GetRepoURL returns the repo URL of the current build, only works with the git plugin enabled
func (*JenkinsConfigProvider) GetStageName ¶
func (j *JenkinsConfigProvider) GetStageName() string
GetStageName returns the stage name the job is currently in, e.g. Promote
func (*JenkinsConfigProvider) InitOrchestratorProvider ¶
func (j *JenkinsConfigProvider) InitOrchestratorProvider(settings *OrchestratorSettings)
InitOrchestratorProvider initializes the Jenkins orchestrator with credentials
func (*JenkinsConfigProvider) IsPullRequest ¶
func (j *JenkinsConfigProvider) IsPullRequest() bool
IsPullRequest returns boolean indicating if current job is a PR
func (*JenkinsConfigProvider) OrchestratorType ¶
func (j *JenkinsConfigProvider) OrchestratorType() string
OrchestratorType returns the orchestrator type Jenkins
func (*JenkinsConfigProvider) OrchestratorVersion ¶
func (j *JenkinsConfigProvider) OrchestratorVersion() string
OrchestratorVersion returns the orchestrator version currently running on
type Orchestrator ¶
type Orchestrator int
const ( Unknown Orchestrator = iota AzureDevOps GitHubActions Jenkins )
func DetectOrchestrator ¶
func DetectOrchestrator() Orchestrator
DetectOrchestrator returns the name of the current orchestrator e.g. Jenkins, Azure, Unknown
func (Orchestrator) String ¶
func (o Orchestrator) String() string
type OrchestratorSettings ¶
OrchestratorSettings struct to set orchestrator specific settings e.g. Jenkins credentials
type OrchestratorSpecificConfigProviding ¶
type OrchestratorSpecificConfigProviding interface { InitOrchestratorProvider(settings *OrchestratorSettings) OrchestratorType() string OrchestratorVersion() string GetStageName() string GetBranch() string GetBuildURL() string GetBuildID() string GetJobURL() string GetJobName() string GetCommit() string GetPullRequestConfig() PullRequestConfig GetRepoURL() string IsPullRequest() bool GetLog() ([]byte, error) GetPipelineStartTime() time.Time GetBuildStatus() string GetBuildReason() string }
func NewOrchestratorSpecificConfigProvider ¶
func NewOrchestratorSpecificConfigProvider() (OrchestratorSpecificConfigProviding, error)
type PullRequestConfig ¶
type UnknownOrchestratorConfigProvider ¶
type UnknownOrchestratorConfigProvider struct{}
func (*UnknownOrchestratorConfigProvider) GetBranch ¶
func (u *UnknownOrchestratorConfigProvider) GetBranch() string
GetBranch returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetBuildID ¶
func (u *UnknownOrchestratorConfigProvider) GetBuildID() string
GetBuildID returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetBuildReason ¶
func (u *UnknownOrchestratorConfigProvider) GetBuildReason() string
GetBuildReason returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetBuildStatus ¶
func (u *UnknownOrchestratorConfigProvider) GetBuildStatus() string
GetBuildStatus returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetBuildURL ¶
func (u *UnknownOrchestratorConfigProvider) GetBuildURL() string
GetBuildURL returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetCommit ¶
func (u *UnknownOrchestratorConfigProvider) GetCommit() string
GetCommit returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetJobName ¶
func (u *UnknownOrchestratorConfigProvider) GetJobName() string
GetJobName returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetJobURL ¶
func (u *UnknownOrchestratorConfigProvider) GetJobURL() string
GetJobURL returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetLog ¶
func (u *UnknownOrchestratorConfigProvider) GetLog() ([]byte, error)
GetLog returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetPipelineStartTime ¶
func (u *UnknownOrchestratorConfigProvider) GetPipelineStartTime() time.Time
GetPipelineStartTime returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetPullRequestConfig ¶
func (u *UnknownOrchestratorConfigProvider) GetPullRequestConfig() PullRequestConfig
GetPullRequestConfig returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetRepoURL ¶
func (u *UnknownOrchestratorConfigProvider) GetRepoURL() string
GetRepoURL returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) GetStageName ¶
func (u *UnknownOrchestratorConfigProvider) GetStageName() string
GetStageName returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) InitOrchestratorProvider ¶
func (u *UnknownOrchestratorConfigProvider) InitOrchestratorProvider(settings *OrchestratorSettings)
InitOrchestratorProvider returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) IsPullRequest ¶
func (u *UnknownOrchestratorConfigProvider) IsPullRequest() bool
IsPullRequest returns false for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) OrchestratorType ¶
func (u *UnknownOrchestratorConfigProvider) OrchestratorType() string
OrchestratorType returns n/a for the unknownOrchestrator
func (*UnknownOrchestratorConfigProvider) OrchestratorVersion ¶
func (u *UnknownOrchestratorConfigProvider) OrchestratorVersion() string
OrchestratorVersion returns n/a for the unknownOrchestrator