1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/pkg/orchestrator/unknownOrchestrator.go
ffeldmann ccc1c976ee
fix(orchestrator) usage of correct env variables (#3650)
* Reorders getApiInformation, changes variables to get start time, adjusts and adds test cases
* Changes the way to get apiInformation and reduces number of requests
* Changes getting pipeline start time from correct env variable
* Refactors getApiInformation functionality
* Adds GetBuildReason() for Azure and Jenkins
* Updates JobURL for ADO
2022-03-28 09:52:15 +02:00

114 lines
3.8 KiB
Go

package orchestrator
import (
"github.com/SAP/jenkins-library/pkg/log"
"time"
)
type UnknownOrchestratorConfigProvider struct{}
// InitOrchestratorProvider returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) InitOrchestratorProvider(settings *OrchestratorSettings) {
log.Entry().Warning("Unknown orchestrator - returning default values.")
}
// OrchestratorVersion returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) OrchestratorVersion() string {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return "n/a"
}
// GetBuildStatus returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetBuildStatus() string {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return "FAILURE"
}
// GetBuildReason returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetBuildReason() string {
log.Entry().Infof("Unknown orchestrator - returning default values.")
return "n/a"
}
// GetBuildID returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetBuildID() string {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return "n/a"
}
// GetJobName returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetJobName() string {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return "n/a"
}
// OrchestratorType returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) OrchestratorType() string {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return "Unknown"
}
// GetLog returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetLog() ([]byte, error) {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return []byte{}, nil
}
// GetPipelineStartTime returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetPipelineStartTime() time.Time {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return time.Time{}.UTC()
}
// GetStageName returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetStageName() string {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return "n/a"
}
// GetBranch returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetBranch() string {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return "n/a"
}
// GetBuildURL returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetBuildURL() string {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return "n/a"
}
// GetJobURL returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetJobURL() string {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return "n/a"
}
// GetCommit returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetCommit() string {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return "n/a"
}
// GetRepoURL returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetRepoURL() string {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return "n/a"
}
// GetPullRequestConfig returns n/a for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) GetPullRequestConfig() PullRequestConfig {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return PullRequestConfig{
Branch: "n/a",
Base: "n/a",
Key: "n/a",
}
}
// IsPullRequest returns false for the unknownOrchestrator
func (u *UnknownOrchestratorConfigProvider) IsPullRequest() bool {
log.Entry().Warning("Unknown orchestrator - returning default values.")
return false
}