Oliver Nocon
ef99f710ae
artifactPrepareVersion: documentation ( #1365 )
...
* artifactPrepareVersion: documentation
* Fix CodeClimate finding
* Update generated file
* Update versioning.yaml
* Update docs wrt PR 1374
* update generated step
* Update resources/metadata/versioning.yaml
Co-Authored-By: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
* Update resources/metadata/versioning.yaml
Co-Authored-By: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
* update generated file
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-04-08 09:28:03 +02:00
Oliver Nocon
909c77045d
artifactPrepareVersion: new versioning option ( #1374 )
2020-04-07 13:27:36 +02:00
Florian Wilhelm
9372aa1f43
Relax requirements for maven projects in nexus upload ( #1348 )
...
* iterate over found pom.xml files for maven projects, deploy found artifacts
* classifiers are found by testing prefix/suffix of artifact
* Remove additionalClassifiers option
* Improve documentation
* Fix fallback for finalBuildName
* Ignore mvn modules with packaging != pom but no target dir
* Fail when main artifact is missing, add more tests
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-04-03 21:32:38 +02:00
Oliver Nocon
999197b919
Add step to prepare the version for an artifact ( #1343 )
2020-04-03 16:34:40 +02:00
Christopher Fenner
2fb304588e
fix(sonar): use SONAR_TOKEN in Sonar go ( #1357 )
2020-04-02 10:44:22 +02:00
Stephan Aßmus
da0f25fd7b
Piper-Go: Allow aliases also for inputs of type "secret" ( #1355 )
...
* Fix typos
* Support aliases also for secrets
* Adapt & extend Unit Tests
* Output deprecation warning for param/secret aliases
... if the alias is marked as 'deprecated'.
2020-04-01 20:46:33 +02:00
Dominik Lendle
5fba815fe8
Transformation of cfCreateServiceKey to Golang ( #1253 )
2020-04-01 11:45:31 +02:00
Stephan Aßmus
96030304a1
Restore possibility to run piper without config file ( #1345 )
2020-03-31 16:06:27 +02:00
Stephan Aßmus
0b8b6f2b0c
Migrate stage artifact deployment from Cloud SDK Pipeline-Lib ( #1324 )
...
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
Co-authored-by: Florian Geckeler <f.geckeler@sap.com>
2020-03-31 15:16:18 +02:00
Florian Geckeler
bb72c38413
Add documentation for mavenExecuteStaticCodeChecks groovy part ( #1339 )
...
* Add documentation for mavenExecuteStaticCodeChecks groovy part
* Add import
* Remove wrong default
* Add markdown file
* Add mkdocs
* Update vars/mavenExecuteStaticCodeChecks.groovy
Co-Authored-By: Daniel Kurzynski <daniel.kurzynski@sap.com>
* remove import
* remove import
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-03-31 11:29:44 +02:00
Daniel Mieg
86dd37c035
Increase timeout ( #1319 )
...
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-03-31 10:56:57 +02:00
Oliver Nocon
91b6b0900f
Config and Defaults via http(s) ( #1302 )
...
* Config and Defaults via http(s)
Add the possibility to use http(s) urls as path to
* config.yml
* defaults
* Remove comment
* Addressing PR feedback
* Fix error handling
2020-03-31 08:47:09 +02:00
Florian Geckeler
bd92804745
Add static code checks stage ( #1308 )
...
* Add static code checks stage
* Rework go step to accept thresholds for the checks and fail maven build if above the thresholds
2020-03-30 15:59:59 +02:00
Stephan Aßmus
03096b5d05
Pass custom default-config files and custom project config from Jenkins side to piper ( #1333 )
2020-03-30 14:31:24 +02:00
Daniel Kurzynski
a40ac015a8
Add tests for maven build ( #1276 )
2020-03-26 08:23:21 +01:00
Stephan Aßmus
804bd8e3e0
http.go: Set fine-grained timeouts ( #1257 )
...
* Replace the default maximum request deadline with a default timeout on the transport level.
* Keep the possibility to set a maximum request deadline.
2020-03-23 15:02:22 +01:00
Stephan Aßmus
4f7955bede
Fix CLI exec call building for keytool ( #1307 )
2020-03-23 13:29:42 +01:00
Christopher Fenner
60b7d3a8df
refactor(sonar): implement Sonar step in GO ( #1042 )
...
* refactor(sonar): add initial metadata file for GO-based sonar step
* refactor(sonar): add initial generated files for GO-based sonar step
* refactor(sonar): add initial step file for GO-based sonar step
* refactor(sonar): add sonar cmd to executable
* refactor(sonar): cleanup metadata file
* fix(go): use capital TLS in golang names
* add download of Sonar scanner cli
* move download & unzip methods to FileUtils
* download certificate files
* use http.Downloader
* update generated code
* add slice prefix function
* update sonar step
* add test cases
* update docs
* use node:lts image
* use latest sonar-scanner
* add test cases
* use latest sonar-scanner
* fix test case
* change things
* return errors on functions
* limit changeID visibility
* use lowercase scm provider
* add test case for legacy PRs
* add test case
* update docs
* use local temp dir
* extend parameter visibility to GENERAL
* use SONAR_AUTH_TOKEN
* remove comments
* update generated code
* Apply suggestions from code review
* change to private fields
* use setter for sonar options & environment
* remove obsolete return statement
* add comment about Downloader mock
* add test case for custom options
* handle custom options
* refactor slice functions
* fix go fmt
* fix generated step code
* update docs
2020-03-23 10:38:31 +01:00
Stephan Aßmus
20b65d5a2e
Implement nexusUpload command and tests ( #1255 )
...
Artifacts to upload are assembled for MTA projects and Maven projects with optional application sub-module. Then maven deploy:deploy-file is used as backend to upload bundles of artifacts plus sub-artifacts.
Co-authored-by: Florian Wilhelm <florian.wilhelm02@sap.com>
2020-03-20 18:20:52 +01:00
Oliver Nocon
8fbeddb26c
Golang step metadata: Config aliases for steps ( #1293 )
...
* Golang step metadata: Config aliases for steps
This will ease following scenarios:
* config migration due to step name changes
* re-use of more general config, e.g. `mavenExecute` in `mavenBuild`
* fix CodeClimate finding
* Fix panic if original stage config does not exist yet
2020-03-19 17:24:35 +01:00
Daniel Kurzynski
4e9e31810c
Config maven in general
2020-03-17 12:09:08 +01:00
Daniel Mieg
81708648e4
Improve error handling ( #1263 )
2020-03-17 10:54:48 +01:00
Daniel Kurzynski
a923e4cfc2
Add maven build/install step ( #1245 )
2020-03-13 13:32:37 +01:00
Florian Geckeler
9a28e12d5d
Add groovy wrapper for mavenExecuteStaticCodeChecks and rename go step
2020-03-12 15:45:57 +01:00
Christopher Fenner
922a1796e0
fix(mta): add os.Environ() only once to command ( #1260 )
...
* add os.Environ() only once
* correct imports
2020-03-11 15:15:00 +01:00
Florian Geckeler
ed7f4831fb
Fix typo in mavenStaticCodeChecks.yaml
2020-03-10 09:59:22 +01:00
Florian Geckeler
de2909e64b
Add Maven static code checks
...
* add static code checks for maven based projects as:
* pmd plugin
* spotBugs plugin
* test modules as unit-tests and integration-tests will be ignored by default. Additional modules to ignore are configurable
* for pmd: rulesets and excludes are configurable
* for spotBugs: includeFilter and excludeFilter are configurable
2020-03-09 08:58:59 +01:00
Oliver Nocon
622d559eae
Add ServiceKey deletion to cloudFoundryDeleteService step ( #1177 )
2020-03-05 15:35:43 +01:00
Marcus Holl
2918ee52cc
Eliminte envMockRunner ( #1233 )
...
ExecMockRunner and ShellMockRunner both needs an environment. "Extending"
here leads to "subclasses" for both cases. That is more long-winded since
it could be.
2020-03-03 10:26:34 +01:00
Marcus Holl
52b0991a36
Get rid of two dimensional env array ( #1235 )
...
I don't understand why there should be a two dimensional array.
When dealing with envs we have normally a list containing entries like
[]string{"DEBUG=true", "HOME=/home/me"}
Having two dimensional env arrays would mean to have several alternate
environment in the tests at the same time. Don't think there is a need
for that.
2020-03-03 09:26:32 +01:00
Florian Geckeler
783d955654
Add mavenExecute to go lib
2020-02-28 13:09:46 +01:00
Marcus Holl
95a1a4d928
xsDeploy: simplifiy assertions in tests ( #1211 )
2020-02-28 11:20:17 +01:00
Marcus Holl
e10a7f20c7
xs deploy cpe inputs and outputs ( #1111 )
...
Use inputs and outputs from commonPipelineEnvironment
* mtaPath is read as input
* operationId is provided as output and read as input
2020-02-28 11:01:09 +01:00
Marcus Holl
161e0b5d3b
xsDeploy: check for operationId in go layer and return error in case it is missing ( #1109 )
2020-02-28 09:40:22 +01:00
Florian Geckeler
ef330e1eee
Move mock capabilities to pkg/mock/runner and adapt all tests
2020-02-27 12:11:22 +01:00
Christopher Fenner
3794371be3
fix typo ( #1224 )
...
Co-authored-by: Marcus Holl <marcus.holl@sap.com>
2020-02-26 16:21:40 +01:00
Marcus Holl
190a4708a2
go: mta build ( #1128 )
...
move mtaBuild step from groovy to go.
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-02-25 14:33:34 +01:00
Florian Geckeler
48fa0a7521
Add 'Code generated by' header to stepGoTemplate
2020-02-21 12:56:09 +01:00
Marcus Holl
d04edd5e8d
unify mocking for shell and exec runner ( #1120 )
...
* same behaviour for shellRunner and execRunner wrt errors and stdout
* replace shouldFail with shouldFailOnCommand
* [formatting only] format struct
* Move to regex for execptions and stdout
* shrink code
2020-02-21 10:56:53 +01:00
redehnroV
716ac7735d
Fixed error handling gitHubPublishRelease ( #1184 )
2020-02-14 14:56:23 +01:00
redehnroV
be03b3dfc1
Adjust documentation for Protecode ( #1175 )
2020-02-12 15:57:39 +01:00
Marcus Holl
38652eed04
[refactoring] Condence common functions for execRunner and shellRunner into runner interface ( #1127 )
...
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-02-12 10:12:58 +01:00
dominiklendle
2007a94174
Add step cloudFoundryDeleteService ( #1097 )
2020-02-10 14:53:12 +01:00
redehnroV
c37df0d55e
Adjust protecode influx parameter ( #1161 )
2020-02-07 14:12:40 +01:00
redehnroV
2ebf2010b7
Protecode as GoLang ( #1119 )
...
* Protecode as go implementation
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-02-06 16:16:34 +01:00
Sven Merk
3139255312
Fix chars in checkmarx test, improve development.md ( #1154 )
...
* Fix chars in test
* Update DEVELOPMENT.md
* Update DEVELOPMENT.md
* Update DEVELOPMENT.md
2020-02-06 09:43:19 +01:00
Oliver Nocon
cead027bfb
Support yml and yaml extension of config files ( #1153 )
...
* Support yml and yaml extension of config files
* Update cmd/piper.go
Co-Authored-By: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-02-06 09:08:15 +01:00
Daniel Mieg
2e742c7ed3
Fix formatting of documentation ( #1151 )
...
* Fix formatting of documentation
* Regenerate go files
2020-02-05 15:46:14 +01:00
Daniel Mieg
6f0bde154b
Go implementation for abapEnvironmentPullGitRepo() ( #1107 )
2020-02-04 11:43:27 +01:00
Oliver Nocon
9c1bd04752
Streamline step generation ( #1142 )
...
* Streamline step generation
* Include PR feedback, update DEVELOPMENT.md
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-02-04 10:46:43 +01:00
Sven Merk
36423eb78d
Avoid potential collisions among steps ( #1141 )
...
* Avoid potential collisions amongst steps
* Improve code, move to JenkinsUtils
* Improve code
* Improve tests
* Fix test
* Add scope on golang side
2020-02-03 15:25:49 +01:00
Oliver Nocon
b542d15998
Enhance telemetry reporting ( #1133 )
...
* Enhance telemetry reporting
* Use central telemetry data object
* Add duration
Co-Authored-By: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-01-31 14:06:08 +01:00
Oliver Nocon
152c4dc9d2
Pass container image via CPE ( #1113 )
...
* Pass container image via CPE
* Update generated step
* update map name to better represent content
2020-01-29 16:03:18 +01:00
Marcus Holl
40f0a17b45
re-use execRunner for envExecRunner ( #1117 )
...
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-01-29 14:22:43 +01:00
Christopher Fenner
aa3fb8adb4
feat(go): add telemetry reporting ( #1100 )
...
* Add telemetry support
* First round telemetry
* Add telemetry flag
* fix: move files to avoid import cycles
* add noTelemetry as global config option
* Respect telemetry configuration for reporting
* add site id, swa endpoint
* correct logger initialization
* add http logic
* rename init method
* rename consts & types
* convert struct to payload
* convert data to payload string
* move activation flag out of data structure
* extract types to own file
* build query using net/url
* correct field mapping
* extract notify coding to own file
* cleanup parameter mapping
* preare base data
* fix codeclimate issue
* correct test case
* fill values from env
* test all fields
* untrack notify.go
* ignore empty custom values
* cleanup data.go
* add test cases
* cleanup
* add usage reporting to karma step
* add usage reporting to step generator
* externalise siteID
* correct custom field names
* test env handling
* simplify method signature
* revert parameter negation
* correct import
* adjust golden file
* inclease log level
* ignore test case
* Revert "inclease log level"
This reverts commit 70cae0e029
.
* add test case for envvars
* remove duplicate reporting
* remove duplicate reporting
* correct format
* regenerate checkmarx file
* add log message on deactivation
* rename function
* add comments to understand SWA mapping
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-01-29 13:17:54 +01:00
Christopher Fenner
92441577d8
fix(NPM): change NodeJS image to LTS ( #1069 )
...
* change NodeJS image to current LTS
* Update default_pipeline_environment.yml
* Update SonarExecuteScanTest.groovy
* use node:lts-stretch image
2020-01-29 11:17:56 +01:00
Sven Merk
cbe368fe36
Checkmarx as golang ( #1075 )
...
* Added base functionality for checkmarx interaction
* Extend http client with file upload capabilities
* Latest changes
* Add debug logging
* Introduce Uploader interface
* Add tests for checkmarx client
* Hook new checkmarx command
* Improve coverage
* Add tests
* Improved test coverage and fixed code
* Add influx reporting
* Add alternation capabilities
* Add groovy step
* Try fix cmd
* Enhancements
* Fix report generation
* Final performance improvements
* Fix code
* Structure code, cleanup
* Improvements
* Fix codeclimate issue
* Update groovy
* Adapt latest changes to http
* Fix test
* Fix http tests
* Fix test
* Fix test
* Fix test 2
* Fix code
* Fix code 2
* Fix code
* Code
* Fix
* Fix
* Add report and link handling
* Fix returns, add groovy test
* Review comments
* Added doc template
* Docs update
* Remove SAP internals
* Better status display
* Add name to link
* Fix test
* Fix
* Fix verbose handling
* Fix verbose handling 2
* Fix verbose handling 3
* Fix
* Tiny improvements
* Regenerate
* Fix test
* Fix test code
* Fix verbosity issue
* Fix test
* Fix test
* Fix test
2020-01-27 23:40:53 +01:00
Oliver Nocon
73ab887f25
Add kubernetesDeploy step ( #1073 )
...
* Add kubernetesDeploy step
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-01-24 14:30:27 +01:00
Oliver Nocon
a46b57e6b4
Persisted pipeline environment for golang library ( #1091 )
...
* Use commonPipelineEnvironment in go binary
* Update groovy part incl. tests
* Rework structure and naming
* Support influx resources in steps
* Update tests and some cleanups
* Add correct defer handling
* Address PR feedback
* Fix test
* Update resources.go
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-01-15 12:16:25 +01:00
Oliver Nocon
7597c7d228
Add step githubCreatePullRequest ( #1068 )
...
* Add step githubCreatePullRequest
2019-12-16 16:34:12 +00:00
Oliver Nocon
4f57738888
Detect: Add golang implementation ( #1049 )
...
Add detect golang implementation
2019-12-13 09:55:45 +00:00
Marcus Holl
9cd4950437
Don't swallow error raised from file exists helper method ( #1019 )
...
* Don't swallow error raised from file exists helper method
* streamline
2019-12-11 10:13:23 +01:00
Marcus Holl
9ee2926018
xs deploy go ( #931 )
...
introduce xs deploy
2019-12-05 14:22:38 +01:00
Oliver Nocon
8e29b70ea2
Fix parameters for githubPublishrelease ( #1004 )
2019-11-22 15:58:24 +01:00
Marcus Holl
0abda0c67b
Remove redundancy: no duplicate stepName ( #998 )
...
* Remove redundancy: no duplicate stepName
Up to now: provided explicity via command line argument and also contained in the
step metadata (which are as a file also provided as command line argument).
Now it is retrieved from the metadata file.
* Step name is not a required parameter anymore
Since the step name is derived from the config file
* Adjust method signature in test
2019-11-22 10:14:21 +01:00
Oliver Nocon
e671094308
Use piper binary for githubPublishRelease ( #990 )
...
* Use piper binary for githubPublishRelease
2019-11-21 16:34:22 +01:00
Oliver Nocon
0f33f7a2ef
Consider custom defaults in config.yml ( #995 )
...
* Consider custom defaults in config.yml
2019-11-21 16:09:57 +01:00
Marcus Holl
e6f9d541ca
Add stdout/stderr to the interfaces (shellRunner, execRunner) ( #948 )
...
Otherwise we cannot set the streams on the level of the interfaces.
2019-11-19 14:29:53 +01:00
Marcus Holl
c9883bf5b0
Pr/read project config only if it exists ( #959 )
...
* Read the project config only if it exists
This avoid trying reading the file and have the control flow based
on errors. Beside that it helps troubleshooting when we have some
logging (debug level only).
* formatting only
* Adjust log level
2019-11-11 09:52:44 +01:00
Marcus Holl
f4aa5fc377
Let the mocks fail if error is provided from a test ( #940 )
...
There was some command parsing with failure in case it started with fail. That is
IMO less transparent. Now we prepare more explicit with a failure from outside. This
enables us to prepare an error like we expect it in the free wild.
2019-11-07 09:02:11 +01:00
Marcus Holl
7c5a8a73bc
Helper for fileExists ( #954 )
...
Since we need it at several places (next use case will be step xsDeploy) we should
have a helper for that.
2019-11-07 08:17:42 +01:00
Oliver Nocon
ede322c8bb
Export general configuration - part 2 ( #957 )
...
* Export general configuration - part 2
First part in #956 missed to export the elements of the struct ...
* Add comment for exported struct
* Add function for opening config files
2019-11-06 16:22:50 +01:00
Oliver Nocon
bb230d3b9b
Export general configuration ( #956 )
...
Allow for package external access to general configuration.
Use-case: re-use individual steps
2019-11-06 14:07:41 +01:00
Christopher Fenner
ae221a8ea7
Merge branch 'master' into goGithub
2019-11-06 12:28:48 +01:00
Sven Merk
6721c59a30
Merge branch 'master' into cfg-hierarchical-defaults
2019-11-06 12:13:15 +01:00
Oliver Nocon
d9a7faed0f
Merge branch 'master' into goGithub
2019-11-06 10:32:22 +01:00
Marcus Holl
a456282d6a
fix: getting config should also work in case there is no project config ( #951 )
2019-11-06 10:28:15 +01:00
OliverNocon
deb965e2b4
Fix CodeClimate finding with generator update
2019-11-06 09:12:50 +01:00
OliverNocon
5c87d4775c
Ensure asset update for latest release only
2019-11-06 09:05:07 +01:00
Oliver Nocon
147bc745af
Merge branch 'master' into cfg-hierarchical-defaults
2019-11-05 21:52:47 +01:00
Marcus Holl
58128be970
apply formatter ( #950 )
2019-11-05 21:51:44 +01:00
OliverNocon
48bfc10956
Address PR feedback
2019-11-05 17:33:00 +01:00
OliverNocon
1a034aea4c
Update parameter names
2019-11-05 15:13:04 +01:00
OliverNocon
50153f42c7
Add tests
2019-11-05 14:37:44 +01:00
Sven Merk
0ba9baab6a
Merge branch 'master' into cfg-hierarchical-defaults
2019-11-04 16:31:02 +01:00
Sven Merk
c241066e21
Add capability for hierarchical defaults in golang
2019-11-04 16:29:39 +01:00
OliverNocon
4302066327
Merge master
2019-11-04 16:11:13 +01:00
OliverNocon
6256a0b9aa
Update githubPublishRelease
2019-11-04 16:07:30 +01:00
Christopher Fenner
742a67fc60
Add GO logging with logrus ( #938 )
...
* add log package
* add logrus dependency
* add logging to karma step
* add log stepName to generator, respect verbose flag
2019-11-04 14:43:33 +01:00
Marcus Holl
5b2d3a1663
Version command for piper go ( #922 )
2019-10-31 13:57:29 +01:00
Oliver Nocon
101ccaf7f6
Add karma command ( #937 )
2019-10-30 10:08:41 +01:00
OliverNocon
803d9ccbef
Merge branch 'master' of https://github.com/SAP/jenkins-library
2019-10-30 10:05:16 +01:00
Marcus Holl
74dd263834
Prepare testing command/shell executions ( #930 )
...
* Move shell call related mocks to piper_test.go
2019-10-30 09:52:41 +01:00
OliverNocon
b6884832ba
Add karma command
2019-10-30 09:20:25 +01:00
Oliver Nocon
e01b3327fd
Go configuration - add aliasing functionality ( #925 )
...
* Go configuration - add aliasing functionality
This assists in backward compatibility cases.
It is now possible to define per parameter aliases.
2019-10-29 10:58:24 +01:00
Oliver Nocon
d053653a93
Add golang implementation for karma tests ( #919 )
...
* Provide golang based karma step
2019-10-25 14:58:59 +02:00
Oliver Nocon
1f34511407
Provide golang based Piper library ( #915 )
...
* Provide golang based Piper library
This includes the main command
and a sub command for config resolution
2019-10-24 10:59:58 +02:00