1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
Commit Graph

3861 Commits

Author SHA1 Message Date
Christian Volk
ff6a26dd42
feat(malwareExecuteScan): support for vault (#3346)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-12-13 11:58:33 +01:00
Oliver Nocon
cddbdf2ce2
doc: improve stage documentation (#3343)
* remove unnecessary sections in case stage does not contain steps (e.g. confirm stage)
* improve readibiliy of condition section
* fix naming
2021-12-13 11:35:41 +01:00
Marc Bormeth
61d1358ca5
hotfix: Don't write SonarQube coverage metrics to InfluxDB (#3347) 2021-12-10 09:13:25 +01:00
rosemarieB
e6c5c8a72f
Abap refactoring (#3340)
* Update abapAddonAssemblyKitReleasePackages.go

* add error handling for initAAKaaS

* runtime to config, url.QueryEscape, check return body

* Update abapAddonAssemblyKitCheckCVs_test.go

* add log entrys for testing

* correct yaml

* change unmarshal logic

* Update abapAddonAssemblyKitCheckPV_test.go

* adding utils functionality

* Update bfw_test.go

* reset CheckPV

* reset CheckCVs

* reset ReserveNextPackages

* set back CheckPV and CheckCVs

* moving mock

* renaming

* renaming

* moving mocking to checkCVs test

* fixing unittests

* trying mock with comment

* referencing unittest to mockfile

* Update abapAddonAssemblyKitCheckCVs.go

* Update cmd/abapAddonAssemblyKitCheckPV.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* Update cmd/abapAddonAssemblyKitReleasePackages.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* Update cmd/abapAddonAssemblyKitPublishTargetVector.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* Update cmd/abapAddonAssemblyKitReserveNextPackages.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* fixing unittests

* fixing mock comment

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2021-12-09 12:54:18 +01:00
tiloKo
c1dc725fcc
Correct Typo in Log Message (#3333) 2021-12-09 10:37:53 +01:00
Ralf Pannemans
0c79b84d51
fix(cnbBuild): failOnError (#3344) 2021-12-08 17:13:20 +01:00
Marc Bormeth
b760bf48e7
feat: Add debug output to getConfig (#3341)
* Fix Orchestrator detection

* Add unit tests

* Add debug output to getConfig

* Update getConfig.go

* fix whitespaces

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-12-08 10:16:54 +01:00
Marc Bormeth
b213af1089
Add Coverage Info to sonarscan.json (#3262)
* Add coverage metrics to report + influx

* Write unit tests

* Add integration test for Sonar Measures Component Service
2021-12-08 09:02:12 +01:00
Christopher Fenner
d0762f5db9
fix: use correct metadata resolver (#3342)
* fix something

* add default metadata resolver

Co-authored-by: ffeldmann <f.feldmann@sap.com>
2021-12-07 15:54:59 +01:00
Pavel Busko
79f7ccd0f5
feat(cnbBuild): increased platform api compatibility (#3330)
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Benjamin Haegenlaeuer <benjamin.haegenlaeuer@sap.com>
2021-12-07 14:06:35 +01:00
Christopher Fenner
b9eb48c149
fix: add kaniko env var for container detection (#3157)
* add kaniko env var

* Rename kaniko.yaml to kanikoExecute.yaml

* update generated files
2021-12-07 08:38:53 +01:00
Oliver Nocon
9a78fabc89
feat(golangBuild): add new step for building go (#3178)
* feat(golangBuild): add new step for building go

* chore(golangBuild): increase test coverage

* remove indirect dependencies

* cleanup go.sum

* chore: remove trailing spaces

* chore(golangBuild): cleanup params, add groovy wrapper

* fix: update docker options

* update docs

* update installation according to https://golang.org/doc/go-get-install-deprecation

* fix: update installation

* update groovy test exclusion

* Update vars/golangBuild.groovy

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* update branch

* address PR feedback

* fix compilation error

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-12-06 16:17:59 +01:00
kingvvgo
292b1eb7e2
Fix for buildSetting file (#3325)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-12-06 14:50:22 +01:00
rosemarieB
e90856d5bf
Generic build step (#3323)
* new step abapEnvironmentBuild

* Update piper.go

* Update abapEnvironmentBuild.go

* update yaml file

* Logging for debugging

* Update abaputils.go

* Update connector.go

* assigning connector

* delete debugging logging

* Update abapEnvironmentBuild.go

* certificate to yaml

* Update abapEnvironmentBuild.go

* add scope

* Update abapEnvironmentBuild.go

* Update abapEnvironmentBuild.yaml

* change certificate name in yaml

* test my new gitscript

* logging for debugging

* debugging...

* adding options to client.

* skip verification

* debugging

* debugging...

* switch of transportskipverification

* changing connector return

* deleting additional set options

* fixed timeout error

* adding certificate

* testing without certificate set

* testing with certificate set

* download, publish and value logic

* write values to cpe

* logging

* adding condition on string length

* change publishmethod and some logging

* change download method -> using references

* evaluation of parameter for download

* add case for empty string

* adding unittests

* Update mockClient.go

* make abapEnvironmentBuildUtilsBundle powerful

* refactor abapEnvironmentBuild into pieces

* check error message

* check error message 2

* check error message 3

* check error message 4

* remove check error message

* cleanup

* adding unittests

* unittests and docu

* docu

* docu

* Update abapEnvironmentBuild.md

* removing trailing spaces and adding empty lines in docu

* Update abapEnvironmentBuild.md

* fixing unittest and PR recommen

* Update abapEnvironmentPipelineStageBuild.groovy

* Update abapEnvironmentPipelineStageBuild.groovy

* Update abapEnvironmentPipelineStageBuild.groovy

* Update abapEnvironmentPipelineStageBuild.groovy

* changes derived from pull request

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2021-12-06 14:43:37 +01:00
Oliver Nocon
24d8584c3f
chore: update Vault dependency (#3332) 2021-12-06 12:54:42 +01:00
Sven Merk
ae9cb1e6f2
Fix alias definition for agentUrl (#3328)
* Fix alias definition for agentUrl

* Update generated file
2021-12-03 12:16:31 +01:00
Oliver Nocon
a76b9d563d
feat(kubernetesDeploy): consume credentials from environment (#3129)
* feat(kubernetesDeploy): consume credentials from environment

* update vault

* update handling of docker config.json

* chore: remove comments
2021-12-02 12:18:21 +01:00
kingvvgo
b29a2f2264
Add Changes for value of docker image (#3303)
* Add Changes for value of docker image

* Get docker image value

* Fix

* Fix unit

* Add chnages for kaniko and mta builds

* Fix

* Test changes

* Test

* Move func ResolveMetadata to stepmeta.go

* Fix

* Change getConfig.go

* Fix getting docker value for mta, npm and kaniko

* Fix according to suggestions

* Add func to get only value of docker image

* Test empty value of docker image

* Fix for getDockerImageValue

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-12-01 07:46:18 +01:00
kulhadia
347ae68ea9
added the beta notification for cnbBuild step (#3316) 2021-11-30 11:51:00 +01:00
Daniel Mieg
08a0fc0cd4
Update configuration.md (#3322) 2021-11-30 09:24:33 +01:00
Pavel Busko
ac09e6e4aa
feat(cnbBuild): refactored buildEnvVars input property, added resourceRef to the buildpacks (#3310)
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
2021-11-29 11:32:32 +01:00
ffeldmann
d9e30418bc
feat: pipeline reporting, adds logging information to fatal hook and splunk hook (#3308)
* Removes unecessary fields from telemetry, restructuring splunk pkg

* Removes t.skip() and reactivates integration test

* Adjusts tests for fatalHook and helper functions, including log test

* Moves pipelinetelemetry to inner source, removes pipelineTelemetry from telemetry pkg, using generic map[string]interface for splunk

* Removes Read JSON from fatalHook -> moves to inner source

* Removed log output test

* go fmt

* log step telemetry data send to splunk

* Adjusts error logging

* Adds log information in case api information could not be retrieved

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-26 16:11:44 +01:00
Christopher Fenner
950f4287c2
fix: correct env var name for git branch for Jenkins orchestrator implementation (#3311)
* fix: correct env var name for git branch for Jenkins orchestrator implementation

* fix test case
2021-11-26 12:08:22 +01:00
Pavel Busko
aa9c2a6b8b
removed pipelineConfigAndTests from the stashing after build (#3315)
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2021-11-26 10:29:28 +01:00
Pavel Busko
74c0fe5e28
feat(protecodeExecuteScan): use dockerConfigJSON from the commonPipel… (#3248)
* feat(protecodeExecuteScan): use dockerConfigJSON from the commonPipelineEnvironment.custom.dockerConfigJSON

Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2021-11-25 13:12:19 +01:00
Christopher Fenner
835be3c333
feat(sonar): use go-based certificate loading (#3307)
* do not load sap certificates with groovy

* add toggle
2021-11-25 07:42:54 +01:00
Peter Persiel
a21bf22964
Update abapEnvironmentAddons.md: Minor changes to wording/typos (#3309)
* Update abapEnvironmentAddons.md

* Update abapEnvironmentAddons.md
2021-11-24 13:42:26 +01:00
Roland Stengel
6320275f47
Step Parameter Alias deprecate key is ignored (#3158)
* Step Parameter Alias deprecate key is ignored
2021-11-23 15:37:28 +01:00
Peter Persiel
52053fbd47
Update abapEnvironmentAddons.md: Troubleshooting (#3251)
* Update abapEnvironmentAddons.md

* Update abapEnvironmentAddons.md

* Adjusted troubleshooting scenarios

* Fix markdown linting

* correct table format

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2021-11-23 10:19:22 +01:00
tiloKo
081f01f93b
add scope (#3291)
Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
Co-authored-by: Peter Persiel <6087940+peterpersiel@users.noreply.github.com>
2021-11-23 08:50:46 +01:00
Christopher Fenner
ba30ee6def
ci: name release steps (#3304) 2021-11-23 07:39:30 +01:00
ffeldmann
f16b11b804
Removes t.Skip() and re-activates integration test (#3299) 2021-11-19 11:28:15 +01:00
Eugene Kortelyov
d395b362ed
feat: step to execute shell scripts (#3196)
* shell executor initial commit

* functionality updates

* changes in logging implementation (using internal logging), changes in execution

* remove unused field

* remove duplicate from code

* update vault flow and remove unnecessary params

* update generated step file

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-19 10:05:39 +01:00
ffeldmann
42b92d1bfe
Changes for Pipeline Reporting (#3213)
* Adds GetLog() function to orchestrator

* Fixes BUILD_NUMBER env variable

* Fixes correct env var for JENKINS_HOME

* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation

* Adds possibility to read errorJsons; updates splunk package for log files (WIP)

* Uncommenting dev code

* Adds GetLog() function to orchestrator

* Fixes BUILD_NUMBER env variable

* Fixes correct env var for JENKINS_HOME

* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation

* Adds possibility to read errorJsons; updates splunk package for log files (WIP)

* Uncommenting dev code

* Adds GetRequest function which holds the response in memory (not saved to disk)

* Implements GetLog() function for ADO, adds function to read PipelineRuntime

* PAT has been revoked

* Changes http package, s.t. if password only is required basic auth works too

* Adds env variable for azure token, error handling in case of unauthenticated/nil response

* Adds logging output in case env variable can not be read and fallback variable needs to be used

* Adds usage of environment variables for auth, uses jenkins api

* Adds init functionality for orchestrators, updates GetLog() and GetPipelineStartTime() function

* Adds initaliziation function for orchestrator authetnication

* Adds settings struct for orchestrator authentication

* Adds function to whole logfile to Splunk

* Struct for pipeline related telemetry information

* Increase messagebatch size to 10k

* Changes splunk package to a pointer based implementation, updates generated files and corresponding template and tests for splunk

* Changes telemetry package to pointer based implementation to have multiple telemetry objects, adjusted tests and splunk implementation

* Changes content type to txt

* Send telemetry independent of logfiles, increases amount of messages per file

* Adds JobURL for orchestrators and UnknownOrchestrator as fallback

* telemetry makes use of orchestrator specific information

* Adds orchestrator independent correlationID

* Adds custom fields for pipeline status

* go fmt

* Removes env var test - no env variables are read anymore

* Use UnknownOrchestratorConfigProvider in case the orchestrator can not be initalized

* Removes Custom fields from telemetry as these can not be reflected in SWA

* Adds custom telemetry information (piperHash,..) to each step telemetry information

* Removes falltrough in case no orchestrator has been found

* Updates tests for orchestrator package

* Adds orchestrator import in generated files

* Updates generator files for internal library

* Adds orchestrator telemetry information to steps

* Updates generated files, fatalHook writes to cpe

* Go generate from master, go fmt

* Adds Custom Data field LastErrorCode

* Removes GetLog() test

* Update init_unix.go

* Update docker_integration_test_executor.go

* Update integration_api_cli_test.go

* Reverts go1.17 fmt formatting

* Reverts go1.17 fmt formatting

* Reverts go1.17 fmt formatting

* Renames customTelemetryData to stepTelemetryData

* Adjustments to orchestrator-package, cleanup, adds JobName

* Adjusts commonPipelineEnvironment path

* Adds pipelineTelemetry struct to telemetry package, removes pipeline telemetry structs from splunk package

* Go fmt

* Changes path for errorDetails, adds debug information

* Removes custom fields from step, adds orchestrator, commithash to baseMetadata

* Adjusts tests for telemetry package

* Adds tests for orchestrator

* Updates generated files, initalization of splunk client only if its available in the config

* Fixes typo in helper go

* Update pkg/http/downloader.go

* Update pkg/http/downloader.go

* Update pkg/log/fatalHook.go

* Update fatalHook.go

* Update pkg/splunk/splunk.go

* Update pkg/telemetry/data.go

* Adds GetBuildStatus() and GetAPIInformation() to orchestrators

* error formatting

* Bugfix: dont send telemetry data if disabled, adjusts test

* go fmt

* Use correct error handling

* Update pkg/telemetry/telemetry.go

* Fixes telemetry disabled in the tests

* Fixes http tests

* Log fatal errors to logFile

* Adds CustomReportingConfig to hooks

* Cleanup comments in splunk package

* Adds possibility to send telemetry to custom endpoint

* Adds debug output for the payload

* Debug output for the payload as a string

* Adds test cases for changes in telemetry package

* go fmt

* Adds generated files for new step

* Reverts changes for http tests, causing problems with go1.15, changes need to be applied for newer go version >=1.17

* Adjusts test for sonarExecuteScan

* Adjusts test for sonarExecuteScan

* Adds explanation for customreportingConfig

* Makes disableing of customSend more obvious

* Adds custom step reporting to each step, updates generated files, adjusts helper testdata

* fixes unit test wrong usage of logging

* Send pipeline data altough there has been no error, adjust test cases

* Reverts changes for customReporting

* Updates generated files, removes customReporting

* Removes writing errorDetails to CPE

* Reverts usage of customreporting

* go fmt

* reverts changes in http_test

* reverts changes in http_test

* Skips integration cnb test

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-18 17:50:03 +01:00
Pavel Busko
56f58ebd8b
fix(cnbBuild): exclude registry domain from the imageNameTag CPE field (#3296) 2021-11-18 17:16:29 +01:00
Mayur Belur Mohan
3a4f756573
IntegrationArtifact Fixes for issue #3121 (#3286)
Co-authored-by: Roland Stengel <r.stengel@sap.com>
2021-11-18 09:08:03 +01:00
Oliver Nocon
533b77a0be
chore: remove outdated info from doc (#3289) 2021-11-18 08:11:56 +01:00
Oliver Nocon
6c5434f957
feat(checkIfStepActive): support new CRD style conditions (#3254)
* feat: first parts of new run struct

* add parts for new stage condition handling

* update conditions

* feat: finalize conditions and tests

* feat(checkIfStepActive): support new CRD style conditions

* feat(docs): allow generating stage docs

* chore(docs): make step directory configurable

* fix: tests

* add option to output file

* Update checkIfStepActive_test.go
2021-11-18 07:24:00 +01:00
tiloKo
359cf9eeb3
add missing spaces in error message (#3288)
* add missing spaces

* typo: on -> one
2021-11-17 15:06:31 +01:00
Oliver Nocon
0a51561d2c
chore(kaniko): update to latest image (#3280)
* chore(kaniko): update to latest image

* update yaml
2021-11-17 07:49:14 +01:00
Anil Keshav
a92dd234b1
feat (buildSettingsInfo) new common cpe which holds build settings json value (#3272)
* create build settings for maven

* cases for when mavenBuild may be present

* fixing unit test for mavenBuild to include cpe

* changing position of buildSettngsJson to be called atfter build runs

* package

* extending the struct for other build types

* adding values for mta build settings

* changing config data type

* adding npm build settings

* unit tests

* fix trailing space

* typo correction in yaml

* Vitalii/build settings info (#3277)

* Add buildsettings package

* Improve buildSetting package for mta, npm

* Add unit-test

* Fix

* Fix

Co-authored-by: Vitalii Sidorov <vitalii.sidorov@sap.com>

* review changes

* removing buildTool param

* changing npm script name

* fix npmExecute tests

* including build settings info in npm struct

Co-authored-by: Your Name <you@example.com>
Co-authored-by: kingvvgo <56587879+kingvvgo@users.noreply.github.com>
Co-authored-by: Vitalii Sidorov <vitalii.sidorov@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-16 15:02:57 +01:00
Peter Persiel
9c700c6f0a
Update abapEnvironmentAddons.md: Refine branch change description (#3274)
* Update abapEnvironmentAddons.md

* Update abapEnvironmentAddons.md

* Update abapEnvironmentAddons.md

* Update abapEnvironmentAddons.md

* Update abapEnvironmentAddons.md

* Update documentation/docs/scenarios/abapEnvironmentAddons.md

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>

* Update documentation/docs/scenarios/abapEnvironmentAddons.md

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>

* Update abapEnvironmentAddons.md

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
2021-11-16 09:51:40 +01:00
Daniel Mieg
50b36794b1
Fail properly in Integration Tests (#3282)
* Require success for publish

* Echo and tets

* Fix test

* Improve test

* Update docu

* Let Integration Test throw

* Update publish.md

* Remove condition for publish

* Update docu
2021-11-16 09:32:09 +01:00
Philipp Stehle
f9f0cbfd33
enforce that step metadata yaml file is called <step>.yaml (#3226)
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
2021-11-15 14:20:20 +01:00
Oliver Nocon
7be9b2b038
chore(mbt): update mbt image (#3186)
image `mbtci` has been deprecated and is no longer maintained.
As per: https://hub.docker.com/r/devxci/mbtci

Co-authored-by: Thorsten Duda <thorsten.duda@sap.com>
2021-11-15 14:04:16 +01:00
Mayur Belur Mohan
d3b090e63e
ApiKeyValueMapDownload Command (#3245)
* ApiKeyValueMapDownload Command

* CodeReview Fixes
2021-11-15 13:48:14 +01:00
Marcus Holl
cf62c35b1a
Fix env var replacement (#3260)
* Fix envVar replacement (go part)

* Fix envVar replacement (groovy part)

* insert underscore also after 0-9 (go part)

* insert underscore also after 0-9 (groovy part)

* Adjust tests for trailing numbers

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-15 12:59:49 +01:00
Siarhei Pazdniakou
e97242b7e7
Fixed validation for possibleValues option (#3228)
* Fixed validation for possibleValues option

* Change oneof-custom to possible-values

* go generate

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-15 12:06:48 +01:00
Oliver Nocon
f431054b6f
feat(WhiteSource): consume credentials from cpe (#3206)
* feat: func for Docker config.json

Provide re-use function to create/update Docker conifg.json

* add comment

* update WhiteSource step

* fixes and additional tests
2021-11-15 07:48:40 +01:00
Pavel Busko
a748c533a2
fix(cnbBuild): use relative path for filtering files (#3278)
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
2021-11-12 15:31:54 +01:00