Documentation ¶
Index ¶
- func PersistReportsAndLinks(stepName, workspace string, reports, links []piperutils.Path)
- type Build
- func (b *Build) DownloadAllResults(basePath string, filenamePrefix string) error
- func (b *Build) DownloadResults(filenames []string, basePath string, filenamePrefix string) error
- func (b *Build) EvaluteIfBuildSuccessful(treatWarningsAsError bool) error
- func (b *Build) Get() error
- func (b *Build) GetResult(name string) (*Result, error)
- func (b *Build) GetResults() error
- func (b *Build) GetValues() error
- func (b *Build) IsFinished() bool
- func (b *Build) Poll() error
- func (b *Build) PrintLogs() error
- func (b *Build) PublishAllDownloadedResults(stepname string, publish Publish)
- func (b *Build) PublishDownloadedResults(stepname string, filenames []string, publish Publish) error
- func (b *Build) Start(phase string, inputValues Values) error
- type ClMock
- type Connector
- func (conn Connector) Download(appendum string, downloadPath string) error
- func (conn Connector) Get(appendum string) ([]byte, error)
- func (conn *Connector) GetToken(appendum string) error
- func (conn *Connector) InitAAKaaS(aAKaaSEndpoint string, username string, password string, ...) error
- func (conn *Connector) InitBuildFramework(config ConnectorConfiguration, com abaputils.Communication, ...) error
- func (conn Connector) Post(appendum string, importBody string) ([]byte, error)
- func (conn Connector) UploadSarFile(appendum string, sarFile []byte) error
- func (conn Connector) UploadSarFileInChunks(appendum string, fileName string, sarFile []byte) error
- type ConnectorConfiguration
- type DownloadClientMock
- type HTTPSendLoader
- type MockClient
- func (mc *MockClient) Add(Method, Url, Body string)
- func (mc *MockClient) AddBody(Method, Url, Body string, StatusCode int, header http.Header)
- func (mc *MockClient) AddData(data MockData)
- func (mc *MockClient) AddResponse(Method, Url string, response http.Response)
- func (mc *MockClient) DownloadFile(Url, filename string, header http.Header, cookies []*http.Cookie) error
- func (mc *MockClient) SendRequest(Method, Url string, bdy io.Reader, hdr http.Header, cookies []*http.Cookie) (*http.Response, error)
- func (mc *MockClient) SetOptions(opts piperhttp.ClientOptions)
- type MockData
- type Publish
- type Result
- type RunState
- type Value
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PersistReportsAndLinks ¶
func PersistReportsAndLinks(stepName, workspace string, reports, links []piperutils.Path)
Types ¶
type Build ¶
type Build struct { Connector Connector BuildID string `json:"build_id"` RunState RunState `json:"run_state"` ResultState resultState `json:"result_state"` Phase string `json:"phase"` Entitytype string `json:"entitytype"` Startedby string `json:"startedby"` StartedAt string `json:"started_at"` FinishedAt string `json:"finished_at"` Tasks []task Values []Value }
Build : Information for all data comming from Build Framework
func GetMockBuildTestDownloadPublish ¶
func GetMockBuildTestDownloadPublish() Build
func (*Build) DownloadAllResults ¶
DownloadAllResults : Downloads all build artefacts, saves it to basePath and the filenames can be modified with the filenamePrefix
func (*Build) DownloadResults ¶
DownloadResults : Download results which are specified in filenames
func (*Build) EvaluteIfBuildSuccessful ¶
EvaluteIfBuildSuccessful : Checks the finale state of the build framework
func (*Build) PublishAllDownloadedResults ¶
PublishAllDownloadedResults : publishes all build artefacts which were downloaded before
type ClMock ¶
ClMock : Mock for Build Framework Client used for BF test
func (*ClMock) SendRequest ¶
func (c *ClMock) SendRequest(method string, url string, bdy io.Reader, hdr http.Header, cookies []*http.Cookie) (*http.Response, error)
SendRequest : BF Send Fake request
func (*ClMock) SetOptions ¶
func (c *ClMock) SetOptions(opts piperhttp.ClientOptions)
SetOptions : BF Client options
type Connector ¶
type Connector struct { Client piperhttp.Sender DownloadClient piperhttp.Downloader Header map[string][]string Baseurl string MaxRuntime time.Duration // just as handover parameter for polling functions PollingInterval time.Duration // just as handover parameter for polling functions }
Connector : Connector Utility Wrapping http client
func (*Connector) InitAAKaaS ¶
func (conn *Connector) InitAAKaaS(aAKaaSEndpoint string, username string, password string, inputclient piperhttp.Sender) error
InitAAKaaS : initialize Connector for communication with AAKaaS backend
func (*Connector) InitBuildFramework ¶
func (conn *Connector) InitBuildFramework(config ConnectorConfiguration, com abaputils.Communication, inputclient HTTPSendLoader) error
InitBuildFramework : initialize Connector for communication with ABAP SCP instance
func (Connector) UploadSarFile ¶
UploadSarFile : upload *.sar file
type ConnectorConfiguration ¶
type ConnectorConfiguration struct { CfAPIEndpoint string CfOrg string CfSpace string CfServiceInstance string CfServiceKeyName string Host string Username string Password string AddonDescriptor string MaxRuntimeInMinutes int CertificateNames []string }
ConnectorConfiguration : Handover Structure for Connector Creation
type DownloadClientMock ¶
type DownloadClientMock struct{}
DownloadClientMock : Mock for Download Client used for artefact test
func (*DownloadClientMock) DownloadFile ¶
func (dc *DownloadClientMock) DownloadFile(url, filename string, header http.Header, cookies []*http.Cookie) error
DownloadFile : Empty file download
func (*DownloadClientMock) SetOptions ¶
func (dc *DownloadClientMock) SetOptions(opts piperhttp.ClientOptions)
SetOptions : Download Client options
type HTTPSendLoader ¶
type HTTPSendLoader interface { piperhttp.Sender piperhttp.Downloader }
HTTPSendLoader : combine both interfaces [sender, downloader]
type MockClient ¶
MockClient : use NewMockClient for construction
func GetBuildMockClient ¶
func GetBuildMockClient() MockClient
GetBuildMockClient : Constructs a Mock Client with example build Requests/Responses
func GetBuildMockClientToRun2Times ¶
func GetBuildMockClientToRun2Times() MockClient
GetBuildMockClientToRun2Times : Constructs a Mock Client with example build Requests/Responses, this can run two times
func NewMockClient ¶
func NewMockClient() MockClient
NewMockClient : Constructs a new Mock Client implementing piperhttp.Sender
func (*MockClient) Add ¶
func (mc *MockClient) Add(Method, Url, Body string)
Add : adds a response with the given Body and statusOK to the mock lib
func (*MockClient) AddBody ¶
func (mc *MockClient) AddBody(Method, Url, Body string, StatusCode int, header http.Header)
AddBody : adds a response with the given data to the mock lib
func (*MockClient) AddData ¶
func (mc *MockClient) AddData(data MockData)
AddData : add the mock Data as response to the mock lib
func (*MockClient) AddResponse ¶
func (mc *MockClient) AddResponse(Method, Url string, response http.Response)
AddResponse : adds a response object to the mock lib
func (*MockClient) DownloadFile ¶
func (mc *MockClient) DownloadFile(Url, filename string, header http.Header, cookies []*http.Cookie) error
DownloadFile : Empty file download
func (*MockClient) SendRequest ¶
func (mc *MockClient) SendRequest(Method, Url string, bdy io.Reader, hdr http.Header, cookies []*http.Cookie) (*http.Response, error)
SendRequest sets a HTTP response for a client mock
func (*MockClient) SetOptions ¶
func (mc *MockClient) SetOptions(opts piperhttp.ClientOptions)
SetOptions : dummy as of now
type Publish ¶
type Publish interface {
PersistReportsAndLinks(stepName, workspace string, reports, links []piperutils.Path)
}
*****************publish *******************************
type Result ¶
type Result struct { BuildID string `json:"build_id"` TaskID int `json:"task_id"` Name string `json:"name"` AdditionalInfo string `json:"additional_info"` Mimetype string `json:"mimetype"` SavedFilename string DownloadPath string // contains filtered or unexported fields }
Result : Artefact from Build Framework step
func (*Result) DownloadWithFilenamePrefixAndTargetDirectory ¶
func (result *Result) DownloadWithFilenamePrefixAndTargetDirectory(basePath string, filenamePrefix string) error
DownloadWithFilenamePrefixAndTargetDirectory : downloads build artefact, saves it to basePath and the filename can be modified with the filenamePrefix
type RunState ¶
type RunState string
RunState : Current Status of the Build
const ( // Initializing : Build Framework prepared Initializing RunState = "INITIALIZING" // Accepted : Build Framework triggered Accepted RunState = "ACCEPTED" // Running : Build Framework performs build Running RunState = "RUNNING" // Finished : Build Framework ended successful Finished RunState = "FINISHED" // Failed : Build Framework endded with error Failed RunState = "FAILED" )