1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
Commit Graph

467 Commits

Author SHA1 Message Date
Oliver Nocon
5856e35d50
Add step to set GitHub status (#2012)
* add step for GitHub branch protection check

* add command to piper command

* remove unnecessary parameter

* Update resources/metadata/githubbranchprotection.yaml

* Add step to set GitHub status

* add groovy part

* update generation & go mod tidy

* update groovy tests

* update github api to fix bug

* add comment

* go mod tidy

* update naming

* update docs

* update docs

* Update resources/metadata/githubstatus.yaml

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* Update resources/metadata/githubstatus.yaml

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* Update resources/metadata/githubstatus.yaml

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* update generated files

* update GitHub step order

* Update interface usage

* do not export interfaces

* go mod tidy

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-09-14 18:08:24 +02:00
Stephan Aßmus
6a0d694d0c
Revert adding JaCoCo report paths to options (#2017) 2020-09-14 17:40:02 +02:00
Oliver Nocon
eef3bcde60
Add step for GitHub branch protection check (2) (#2016)
* add step for GitHub branch protection check

* add command to piper command

* remove unnecessary parameter

* Update resources/metadata/githubbranchprotection.yaml

* add groovy part

* update generation & go mod tidy

* update groovy tests

* fix bug with go-github version

* Add step to check GitHub branch protection settings

* include PR review feedabck

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-09-14 12:05:12 +02:00
Oliver Nocon
d68e466c28
Revert "Add step for GitHub branch protection check (#2010)" (#2014)
This reverts commit f1cfca2e76.
2020-09-11 18:56:51 +02:00
Kevin Hudemann
a57e3bf0ce
Fix runStep condition for mavenExecuteStaticCodeChecks (#2009)
This change fixes the step mavenExecuteStaticCodeChecks to skip execution
if no tool is configured. Previously, the step was executed even when both 
supported tools, i.e., PMD and SpotBugs were disabled.
2020-09-11 16:16:00 +02:00
Oliver Nocon
f1cfca2e76
Add step for GitHub branch protection check (#2010)
* add step for GitHub branch protection check

* add command to piper command

* remove unnecessary parameter

* Update resources/metadata/githubbranchprotection.yaml

* add groovy part

* update generation & go mod tidy

* update groovy tests

* fix bug with go-github version

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-09-11 15:28:43 +02:00
Stephan Aßmus
eb09f2d902
Extend sonarExecuteScan parameters (#1982)
* Add projectKey and coverageExclusions params
* Also add binary, coverage exclusions and jacoco related options to sonar execution.

Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
Co-authored-by: Kevin Hudemann <kevin.hudemann@sap.com>
2020-09-11 13:39:17 +02:00
Oliver Feldmann
41abec6b10
Fix generator typo (#2008)
* Fix typo in generator code

* Fix typo in generated code
2020-09-10 14:37:46 +02:00
Sven Merk
51158d2457
checkmarxExecuteScan: Fix access to projects (#1997) 2020-09-10 11:14:58 +02:00
Florian Wilhelm
9d6517ff7a
Add command for commandline completion scripts (#1983)
Small change to allow better interactive cli usage of piper. This makes use of cobra's feature as described here https://github.com/spf13/cobra/blob/master/shell_completions.md
2020-09-07 15:22:01 +02:00
Christopher Fenner
f7d881d602
fix(protecode): correct project naming (#1975)
* fix project naming

* add test case for getTarName

* correct tar filename generation

* handle empty version
2020-09-02 15:00:55 +02:00
Christopher Fenner
b59bac7892
fix(protecode): respect failOnSevereVulnerabilities parameter (#1969)
* fix redundant type issues

* cleanup

* extract report function for protecode package

* use speaking status constant for API results

* remove unconsidered return value

* correct switch statement

* handle severe vulnerabilities

* Apply suggestions from code review

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* correct test name

* return errors from WriteReport function

* expose ReportData struct

* set Error Category

* refactor constant visibility

* change type name

* describe type

* change type name

* fail after report generation

* do not fail on report write errors

* add error as return value

* fix typo

* use require statements

* assert major vulnerabilities

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-09-02 10:41:12 +02:00
Dominik Lendle
e84c417555
Hotfix for empty checkstyle XML (#1967)
* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* Changed yaml aliases

* Adapted naming conventions

* Removed error code at the end

* Adapted configuration

* Minor changes

* Minor changes

* Minor changes

* Removed spaces

* Removed docker-related config from groovy file

* Minor changes

* Minor changes

* Removed container config

* Corrected testing function name

* Deleted unnecessary parts

* Changed service deletion message

* Changed service deletion message

* Logging out before throwing error service deletion step fails

* Minor changes

* Minor changes

* Minor changes

* Delete .DS_Store

* Delete .DS_Store

* Delete .DS_Store

* Delete .DS_Store

* Minor changes

* Minor changes

* Minor changes

* Added newline at end of file

* Added newline at end of file

* Changes for Pull request optimization

* added documentaion

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Added CFDeleteServiceKeys

* Added ServiceKey deletion tests

* added cfServiceKeys flag explanation to documentation

* removed trailing spaces from documentation

* resolving conflicts

* Changed deletion message an variable naming

* Changed tests

* Changed tests

* Changed tests

* Changed tests

* Changed CloudFoundryDeleteServiceOptions to options

* Changed CloudFoundryDeleteServiceOptions to options

* Minor changes

* Minor changes

* Changed variable naming

* Changed error handling

* Changed error handling and logging

* Changed documentation

* Simplified code

* Fixed CodeClimate issues

* Changed from returning err to nil where no errur returned needed

* Add cloudFoundryCreateServiceKey Go Step

* Changed Groovy File

* Changed aliases

* Removed unneccessary parts

* Minor changes

* Minor changes

* Adapted documentation

* Adapted tests

* Adapted Groovy File

* Changed Groovy file

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Removed Groovy Tests for cfCreateServiceKey

* Minor changes

* Added ATC Check YAML

* Added ATC Check generated files

* Added test class

* Added abapEnvironmentRunATCCheck

* Minor changes

* Minor changes

* Changed groovy

* Minor changes

* Changed groovy

* Changed groovy

* Minor changes

* Adapted Groovy imports

* Adapted Groovy imports

* Adapted Groovy imports

* Adapted Groovy

* Getting ATC results

* Changed error message

* changed groovy

* removed trailing spaces

* Added login check

* Minor changes

* Added step to whitelistScriptReference

* Added ATC error message handling

* Added groovy file

* Added step to groovy tests

* corrected metadata file

* Debugging

* Debugging

* Added yaml config parameter for ATC run

* Adapted file location of ATC run config to jenkins specific location

* Implementing universal pipeline logic for finding yaml config regardless of pipeline

* Changed error handling for reading config yaml file

* Changed atcrunconfig alias

* minor changes

* Minor changes

* Minor changes

* Changed back to dynamic file reading

* Minor changes

* filepath changes

* Removing CF Login

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Removed whitespaces

* Added CF functions unit tests

* Added invalid parameter handling

* Removed package and SC flag

* Minor changes

* Changed tests

* Changed tests

* Changed tests

* Minor changes

* Changed tests

* removed unnecessary logout

* Added documentation

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Removed trailing spaces

* Added newline at end of file

* code climate fixes

* code climate fixes

* code climate fixes

* Minor changes

* Minor changes

* Minor changes

* Changed tests

* Test changes

* Splitted Cloud Foundry functions into two classes

* Removed two steps from whtielistScriptReference

* removed atcrunConfig alias

* issue fixes

* Changed docu

* Changed docu

* Changed docu

* Removed trailing spaced from docu

* Changed docu

* Go generator run

* Issue fixes

* Remove unnecessary imports

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

* Update whitelistScript

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

* Adding piperutils for writing xml file

* Persisting ATC Results with piperutils

* Set failonMissingReports to true

* Refactoring for CodeClimate

* Changed result file name

* Changed credentials aliases

* changing secret name

* Removing trailing spaces

* Added secret name and alias to docu

* Result displaying changes and checkvariant extension added

* Added docu

* Fix trailing spaces

* Refactoring

* Check for prefix html added

* Persist Results even with empty checkstlye xml

* Tests added for empty checkstyle xml

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-09-01 00:33:46 +02:00
Stephan Aßmus
a44fa4ccda
Make protecodeExecuteScan tests run in temp dir (#1966)
Fixes left-over files in cmd/
2020-08-31 08:45:00 +02:00
Christopher Fenner
8007e4af51
docs: link credentialIDs to parameter (#1961) 2020-08-28 15:38:15 +02:00
rosemarieB
c6e409dfd9
New step: abapEnvironmentAssemblePackages (#1884)
* adding my steps

* messy step

* Update abapEnvironmentAssembly.go

* clean up

* change yaml

* corrections

* Update cloudFoundryDeploy.go

* update

* delete simulation step

* remove simulate

* Update PiperGoUtils.groovy

* Update PiperGoUtils.groovy

* Update CommonStepsTest.groovy

* add docu

* Update abapEnvironmentAssembly.md

* changes due to PR

* Update .gitignore

* b

* CV list

* Update abapEnvironmentAssembly.go

* testing with simulation

* Update abapEnvironmentAssembly.go

* remove simulation

* renaming

* Update mkdocs.yml

* moving service key to yaml and fixing code climate

* Update abapEnvironmentAssemblePackages.go

* Update abapEnvironmentAssemblePackages.go

* Update abapEnvironmentAssemblePackages.go

* Update abapEnvironmentAssemblePackages.go

* change input

* Update abapEnvironmentAssemblePackages.go

* change json tag

* fixed error handling

* documentation

* Update abapEnvironmentAssemblePackages.md

* Update abapEnvironmentAssemblePackages.md

* fixing code climate issues

* fixing code climate issues

* Update abapEnvironmentAssemblePackages.yaml

* fixing code climate issues

* Update abapEnvironmentAssemblePackages.yaml

* adding unittests

* adding unittests and improved logging

* yaml -> json

* change scope of cfServiceKeyName

* correct indentation

* Update CommonStepsTest.groovy

* maintain correct step order

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-08-27 07:54:03 +02:00
Dominik Lendle
c2b4ed819b
Atc check extension and more user-friendly displays of results (#1951) 2020-08-26 14:09:00 +02:00
Daniel Mieg
13e5a943b2
Add groovy file and documentation for cloneGitRepo step (#1954)
* Add groovy file and documentation

* Add quotes to docu

* Fix request
2020-08-26 09:52:50 +02:00
Stephan Aßmus
46284d8f34
Add optional wrapper for cloudFoundryDeploy go-implementation (#1952)
Co-authored-by: Kevin Hudemann <kevin.hudemann@sap.com>
2020-08-24 18:10:45 +02:00
Sacha Droste
f6f85342b7
fix(helm): Remove double deployment of helm charts (#1947)
* Remove double deployment of helm charts

* Adapt unit test

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-08-24 16:05:05 +02:00
veiththomas
48620c3f49
fix(sonar): add default trust store password to SONAR_SCANNER_OPTS (#1941)
* add trustStorePassword to SONAR_SCANNER_OPTS

-Djavax.net.ssl.trustStorePassword=changeit has to be provided to the SONAR_SCANNER_OPTS otherwise we get a 

ERROR: SonarQube server [https://sonar.wdf.sap.corp] can not be reached on our new jenkins server
Caused by: javax.net.ssl.SSLException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

we tried to inject via "options" variable of the sonarExecuteScan task, but seems it is not recognized as it is overwritten by the SONAR_SCANNER_OPTS defined in this file.

* adapt tests

* Update sonarExecuteScan.go

* Update sonarExecuteScan_test.go

* Update sonarExecuteScan.go

* Update sonarExecuteScan_test.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-08-24 14:39:45 +02:00
Daniel Mieg
04b8a5cbd7
Add golang step for abapEnvironmentCloneGitRepo (#1921)
* Add yaml

* Initial files

* Add inital functions

* Create Test file

* Initial trigger clone function

* Add command

* Adapt manageGitRepositoryUtils

* Enable Repositories yaml

* Add handleHttpError Tests

* Adapt CodeClimate Feedback

* Add tests for error messages

* Adapt error messages and handling

* Adapt gitignore
2020-08-21 14:49:48 +02:00
Oliver Nocon
b18bcee533
artifactPrepareVersion: improve error categorization (#1936)
* artifactPrepareVersion: improve error categorization

* Update getConfig.go

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-08-19 20:20:00 +02:00
Stephan Aßmus
07b5142417
Fix cloudFoundryCreateService parameter scopes (#1935) 2020-08-19 19:20:52 +02:00
Dominik Lendle
25c599b03b
Implementing cfCreateService in Golang (#1649)
* Adapted documentation

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Added CFDeleteServiceKeys

* Added ServiceKey deletion tests

* added cfServiceKeys flag explanation to documentation

* removed trailing spaces from documentation

* resolving conflicts

* Changed deletion message an variable naming

* Changed tests

* Changed tests

* Changed tests

* Changed tests

* Changed CloudFoundryDeleteServiceOptions to options

* Changed CloudFoundryDeleteServiceOptions to options

* Minor changes

* Minor changes

* Changed variable naming

* Changed error handling

* Changed error handling and logging

* Changed documentation

* Simplified code

* Fixed CodeClimate issues

* Changed from returning err to nil where no errur returned needed

* Add cloudFoundryCreateServiceKey Go Step

* Changed Groovy File

* Changed aliases

* Removed unneccessary parts

* Minor changes

* Minor changes

* Adapted documentation

* Adapted tests

* Adapted Groovy File

* Changed Groovy file

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Removed Groovy Tests for cfCreateServiceKey

* Minor changes

* Added ATC Check YAML

* Added ATC Check generated files

* Added test class

* Added abapEnvironmentRunATCCheck

* Minor changes

* Minor changes

* Changed groovy

* Minor changes

* Changed groovy

* Changed groovy

* Minor changes

* Adapted Groovy imports

* Adapted Groovy imports

* Adapted Groovy imports

* Adapted Groovy

* Getting ATC results

* Changed error message

* changed groovy

* removed trailing spaces

* Added login check

* Minor changes

* Added step to whitelistScriptReference

* Added ATC error message handling

* Added groovy file

* Added step to groovy tests

* corrected metadata file

* Debugging

* Debugging

* Added yaml config parameter for ATC run

* Adapted file location of ATC run config to jenkins specific location

* Implementing universal pipeline logic for finding yaml config regardless of pipeline

* Changed error handling for reading config yaml file

* Changed atcrunconfig alias

* minor changes

* Minor changes

* Minor changes

* Changed back to dynamic file reading

* Minor changes

* filepath changes

* Removing CF Login

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Removed whitespaces

* Added CF functions unit tests

* Added invalid parameter handling

* Removed package and SC flag

* Minor changes

* Changed tests

* Changed tests

* Changed tests

* Minor changes

* Changed tests

* removed unnecessary logout

* Added documentation

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Removed trailing spaces

* Added newline at end of file

* code climate fixes

* code climate fixes

* code climate fixes

* Minor changes

* Minor changes

* Minor changes

* Changed tests

* Test changes

* Splitted Cloud Foundry functions into two classes

* Removed two steps from whtielistScriptReference

* removed atcrunConfig alias

* issue fixes

* Changed docu

* Changed docu

* Changed docu

* Removed trailing spaced from docu

* Changed docu

* Go generator run

* Issue fixes

* Remove unnecessary imports

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

* Update whitelistScript

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

* Adding piperutils for writing xml file

* Persisting ATC Results with piperutils

* Set failonMissingReports to true

* Refactoring for CodeClimate

* Changed result file name

* Changed credentials aliases

* changing secret name

* Removing trailing spaces

* Added secret name and alias to docu

* PR commit

* Go generator

* Code Climate fixes

* Code Climate fixes

* Code Climate fixes

* Removed existing groovy tests

* Added cfCreateService to fieldRelatedWhiteList

* Remarks

* added file checking

* tests adapted

* Changed to execRunner

* Removed workingDir definition

* Removed workingDir definition

* Removed workingDir definition

* Added default

* Added aliases

* Changing to CFUtils Exec Runner

* Change defaults

* Removed trailing spaces

* Refactoring and test changes

* Added manifest file default & re-arranged defer func

* TestFiles creation added

* Changed alias values

* Corrected defer logout err return

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
2020-08-19 10:17:27 +02:00
Oliver Nocon
ab64219ac4
kubernetesDeploy - improve helm parameter handling (#1931)
* kubernetesDeploy - improve helm parameter handling

* blur secret and update docs

* add support for values

* Update resources/metadata/kubernetesdeploy.yaml

* Update resources/metadata/kubernetesdeploy.yaml

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* Update resources/metadata/kubernetesdeploy.yaml

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-08-18 07:32:36 +02:00
Oliver Nocon
9d2621505b
kubernetesDeploy - fix & updates (#1926)
* kubernetesDeploy - updates

* add debugging output

* fix type checking

* remove debugging output

* fix secret info

* fix tests

* Update vars/commonPipelineEnvironment.groovy

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* Update vars/commonPipelineEnvironment.groovy

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-08-14 17:16:25 +02:00
Stephan Aßmus
b1a0cb089c
piper: Use stageName from parametersJSON, log value and source (#1920)
stageName from parametersJSON was ignored up until now and there was a TODO in the code. The precedence from the TODO is not clear to me. It said "first env.STAGE_NAME, second: parametersJSON, third: flag". So maybe I implemented it wrongly, but it would be easy to change. Right now, STAGE_NAME is always in the ENV when piper is called from Jenkins, but to mimic the behavior of being able to pass `stageName` in the parameters and override the ENV value, this is what happens in go as well now.

The reason why `stageName` needs to be evaluated before other step parameters is that it affects config evaluation. So I've added a function which is called first in `PrepareConfig()`.
2020-08-13 17:55:12 +02:00
Oliver Nocon
c6ffb23fdf
type error: avoid message Error: <nil> (#1918) 2020-08-12 15:41:29 +02:00
Christopher Fenner
173b453d84
refactor(protecode): add explicit parameter for Docker config.json file (#1914)
* add dedicated property to handle docker config file

* switch to dockerConfigJSON in groovy

* use DockerConfigJSON

* add secret reference

* Update protecode.yaml

* Update protecode.yaml

* improve docs

* update generated sources
2020-08-12 14:57:11 +02:00
Kevin Hudemann
771bfd0cf2
Remove sapNpmRegistry (#1909)
The SAP NPM registry has been migrated to the default public registry,
thus the separate configuration with the sapNpmRegistry is not required
anymore.
All packages from npm.sap.com have been migrated to npmjs.org
and in the future SAP packages will only be available from the default
public registry.
2020-08-11 15:58:39 +02:00
Stephan Aßmus
54444c7e33
fortifyExecuteScan: Fix polling project status (#1908) 2020-08-11 15:29:00 +02:00
Christopher Fenner
9340729646
chore(protecode): be more verbose about docker credentials (#1911)
* log more information about docker credentials

* remove println

* fix format issues

* Update protecodeExecuteScan.go

* correct weird space characters

* add test case for correctDockerConfigEnvVar
2020-08-11 14:42:08 +02:00
Daniel Mieg
7ea5b09555
Improve tests for cf steps (#1875)
* Improve Tests for cf steps:
CreateServiceKey and Delete Service

* Fix CodeClimate issues

* Adapt descriptions

* Defer logout
2020-08-10 11:08:34 +02:00
Christopher Fenner
a7213587cb
refactor(protecode): remove unused parameter (#1899)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-08-07 18:59:50 +02:00
Christopher Fenner
0a02fe1fb8
refactor(protecode): handle reports inside go (#1891)
* publish artifacts

* publish project report link

* archive scan report

* fix typo

* remove obsolete reading iof result file

* publish sidebar link

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-08-07 13:03:38 +02:00
Daniel Mieg
766a233c01
Improve testability of abap steps (#1876)
* Change to make pollIntervall configurable

* Adapt checkout
2020-08-07 11:09:58 +02:00
Stephan Aßmus
b8f5fd9b28
fortifyExecuteScan: Pass on maven options to versioning (#1895) 2020-08-07 10:31:15 +02:00
Stephan Aßmus
ec779a719b
Checkmarx: honor "preset" parameter also for existing projects (#1893) 2020-08-06 17:20:26 +02:00
Oliver Nocon
d34f92cd00
kubernetesDeploy: cover helm ImagePullSecrets (#1878)
* kubernetesDeploy: cover helm ImagePullSecrets

* update test

* fix formatting

* fix compatibility
2020-08-06 11:23:36 +02:00
Oliver Nocon
69b145e83f
artifactPrepareVersion: improve error categorization (#1889)
* artifactPrepareVersion: improve error categorization
* go mod tidy
2020-08-06 11:13:19 +02:00
MuellerHenrik
3ab8b52c80
Add documentation + groovy file for the abapEnvironmentCheckoutBranch step (#1887)
* Add abaputils pkg and go files

* Add ReadServiceKeyAbapEnvironment function

* Fixes

* Add structs for SC, Pull and Branch

* Minor Improvements

* Adapt unit tests to new abaputils pkg

* Fixes

* Add adapted tests

* Fixes

* Fix cloudfoundry test

* Add check for host prefix (HTTPS)

* Fix tests + cleanup

* Fixes

* Fixes

* Fix

* Add mock for abaputils pkg unit tests

* Adapt abaputils comments

* Add abapEnvironmentCheckoutBranch step setup

* Change description of abapEnvCheckoutBranch step

* Add http client code

* Disable code due to missing interace

* Add coding for use of abaputils

* Adapt checkout branch step

* Adapt URL for checkout_branch function import

* Fixes

* Add unit test for missing params case

* Fix for missing mapping of CfSpace

* Fix for missing mapping of CfSpace

* Add working code for a Branch Checkout

* Fix host schema

* Remove LogoutOption param of unit tests and steps

* Fix unit test

* Fix unit test CF ReadServiceKey

* Add abapEnvironmentCheckoutBranch step setup

* Change description of abapEnvCheckoutBranch step

* Add http client code

* Disable code due to missing interace

* Add coding for use of abaputils

* Adapt checkout branch step

* Adapt URL for checkout_branch function import

* Fixes

* Fix for missing mapping of CfSpace

* Add working code for a Branch Checkout

* Adapt changes of abautils pkg

* Add test for polling

* Minor fix

* Fix yaml spacing

* Add longdescription to yaml

* Refactor abaputil methods

* Refactoring

* Refactoring

* Minor fix

* Minor fixeds

* Adapt to new abaputils.AUtilsMock

* Delete obsolete initial checks for params

* Fix manageGitRepoUtils_test.go

* Adjust pollEntity tests

* Add abapEnvironmentCheckoutBranch.groovy file

* Add documentation for abapEnvCheckoutBranch step

* Add step to whitelist in commonStepsTest.groovy

* Add GENERAL scope to host parameter

* Fix generated.go file

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
2020-08-06 09:59:55 +02:00
Stephan Aßmus
c54a55287a
checkmarxExecuteScan: Add two (deprecated) aliases (#1883) 2020-08-05 14:15:24 +02:00
MuellerHenrik
164327667c
Add step abapEnvironmentCheckoutBranch (#1832)
* Add abaputils pkg and go files

* Add ReadServiceKeyAbapEnvironment function

* Fixes

* Add structs for SC, Pull and Branch

* Minor Improvements

* Adapt unit tests to new abaputils pkg

* Fixes

* Add adapted tests

* Fixes

* Fix cloudfoundry test

* Add check for host prefix (HTTPS)

* Fix tests + cleanup

* Fixes

* Fixes

* Fix

* Add mock for abaputils pkg unit tests

* Adapt abaputils comments

* Add abapEnvironmentCheckoutBranch step setup

* Change description of abapEnvCheckoutBranch step

* Add http client code

* Disable code due to missing interace

* Add coding for use of abaputils

* Adapt checkout branch step

* Adapt URL for checkout_branch function import

* Fixes

* Add unit test for missing params case

* Fix for missing mapping of CfSpace

* Fix for missing mapping of CfSpace

* Add working code for a Branch Checkout

* Fix host schema

* Remove LogoutOption param of unit tests and steps

* Fix unit test

* Fix unit test CF ReadServiceKey

* Add abapEnvironmentCheckoutBranch step setup

* Change description of abapEnvCheckoutBranch step

* Add http client code

* Disable code due to missing interace

* Add coding for use of abaputils

* Adapt checkout branch step

* Adapt URL for checkout_branch function import

* Fixes

* Fix for missing mapping of CfSpace

* Add working code for a Branch Checkout

* Adapt changes of abautils pkg

* Add test for polling

* Minor fix

* Fix yaml spacing

* Add longdescription to yaml

* Refactor abaputil methods

* Refactoring

* Refactoring

* Minor fix

* Minor fixeds

* Adapt to new abaputils.AUtilsMock

* Delete obsolete initial checks for params

* Fix manageGitRepoUtils_test.go

* Adjust pollEntity tests

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
2020-08-04 17:52:28 +02:00
Oliver Nocon
1c61ba1de3
mtaBuild: improve error categorization (#1873) 2020-07-31 15:41:28 +02:00
Oliver Nocon
3318ba24e4
artifactPrepareVersion: improve error categorization (#1872) 2020-07-31 14:55:22 +02:00
Daniel Mieg
bfa601cd47
Improve testability of abap steps (#1840)
* Test

* Test

* Test abapEnvironmentPullGitRepo step

* Move mock functions

* Add package for mock

* Move mock
2020-07-31 14:43:23 +02:00
Marcus Holl
e41e43611b
cloud foundry deploy go (#1743)
Provide cloudFoundryDeploy step in GO layer.

Groovy part untouched. Groovy-Stub needs to be provided later (with a feature toggle in order to be able to switch back)

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-07-31 12:38:00 +02:00
Daniel Kurzynski
8ee0d358b9
Support maven params in detect scan (#1855)
Co-authored-by: Florian Wilhelm <florian.wilhelm02@sap.com>
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-07-30 10:35:46 +02:00
Stephan Aßmus
9009c831fb
Declare non-optional server URLs mandatory (#1866)
* Declare non-optional server URLs mandatory
2020-07-30 09:13:46 +02:00
Stephan Aßmus
a61798ccbf
New step mavenExecuteIntegration (#1829)
Co-authored-by: Florian Wilhelm <florian.wilhelm02@sap.com>
2020-07-29 19:51:27 +02:00
Oliver Nocon
77028bf50c
kubernetesDeploy: fix commonPipelineEnvironment references (#1863)
* kubernetesDeploy: add step configuration alias

This is used for backward compatibility

* fix commonPipelineEnvironment references

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-07-29 15:48:55 +02:00
Daniel Kurzynski
41d0b761f7
Add mta alias for maven parameter (#1856)
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-07-29 15:39:41 +02:00
Oliver Nocon
bcd450f06e
kubernetesDeploy: add step configuration alias (#1857)
This is used for backward compatibility

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-07-29 11:21:32 +02:00
Stephan Aßmus
40440f8f01
Bugfix: Convert int/float parameters (2nd try) (#1851)
* If a step declares a parameter of type string, depending on how the config is written, it is no longer ignored, if it is interpreted by the yaml parser as integer or float value.
* If an expected parameter is present in the configuration, step execution will consistently fail if the parameter has the wrong type, no sensible conversion can take place, and it is known that the parameter will be ignored.
* For all type-mismatches that have no implemented conversion, a warning is logged. (It isn't known whether the conversion actually works, since it depends on both the yaml and json packages and future changes there.)
* Entries in the evaluated config with a value of nil are ignored.
2020-07-29 09:22:10 +02:00
Oliver Nocon
d691750931
Fix reading of hook configuration (#1854)
* Update piper.go

* Update piper_test.go

* Update config.go

* Update sentryHook.go

* Update piper.go

* go fmt

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-07-28 17:19:33 +02:00
Daniel Kurzynski
bcab73d332
Support m2path for mtaBuild (#1850)
Co-authored-by: Florian Wilhelm <florian.wilhelm02@sap.com>
2020-07-28 17:06:17 +02:00
Giridhar Shenoy
0fc131adec
detectExecuteScan : Changes to include user group and handle build fails (#1775)
* changes to detectExec before master merge

* changes for detectExecuteScan

* self generated code added

* fix syntax errors and update docu

* added unit tests for fail and Group

* fix failOn bug

* add Groups as string array

* add Groups as string array

* tests and validation for groups, failOn

* Updated docs and added more tests

* documentation md files should not be changed

* Handle merge conflicts from PR 1845

* fix merge errors

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-07-28 10:48:19 +02:00
Florian Wilhelm
60796cdc59
Update maven spotbugs plugin to support Java 14 (#1852) 2020-07-28 09:58:56 +02:00
Christopher Fenner
e4113242aa
fix(sonar): correct type for custom TLS certificates (#1847)
* correct type

* correct certificate handling

* adapt test cases

* Update resources/metadata/sonar.yaml

* update
2020-07-27 15:01:30 +02:00
Oliver Nocon
d8553ab53d
detectExecuteScan: update versioning (#1845)
* detectExecuteScan: update versioning

align with Fortify to also use the same versioning model by default.

* fix CodeClimate findings
2020-07-27 12:01:59 +02:00
Stephan Aßmus
0134332a6e
Revert "Bugfix: Convert int/float parameters (#1837)" (#1849)
This reverts commit 7f4fab762d.
2020-07-27 11:13:13 +02:00
Stephan Aßmus
7f4fab762d
Bugfix: Convert int/float parameters (#1837) 2020-07-27 08:30:02 +02:00
MuellerHenrik
af4d871f3c
Create fix for ABAP ATC step (#1834) 2020-07-24 10:39:40 +02:00
Chris Bo
25decaa256
Introducing new step 'gctsRollback' (#1526)
* added new step gctsDeployCommit

* suggested PR fixes applied

* fixed test

* Remove unused imports

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

* added URL encoding for 'request' parameter

* regenerate after change

* add new step gctsRollbackCommit

* fixed typo in docu

* enhanced error messages

* minor changes

* renamed step to 'gctsDeploy'

* changed name

* remove space

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

* changed step name to gctsRollback

* changed function name

* fix conflict

* fixed gctsDeploy step name

* fix typo

* fixed error handling

* added Jenkins credentials for github token

* regenerated

* newly generated

* removed calling piper binary with go function call

* removed unused execRunner parameter

* cleaned up

* fixed merge conflict

* added docu page

* cleaned up

* provide Jenkins creds also in config.yaml

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-07-23 20:20:07 +02:00
MuellerHenrik
e3f914e09d
Add abap utils pkg - ABAP Environment Steps (#1757)
* Add abaputils pkg and go files

* Add ReadServiceKeyAbapEnvironment function

* Fixes

* Add structs for SC, Pull and Branch

* Minor Improvements

* Adapt unit tests to new abaputils pkg

* Fixes

* Add adapted tests

* Fixes

* Fix cloudfoundry test

* Add check for host prefix (HTTPS)

* Fix tests + cleanup

* Fixes

* Fixes

* Fix

* Add mock for abaputils pkg unit tests

* Adapt abaputils comments

* Add unit test for missing params case

* Fix for missing mapping of CfSpace

* Fix host schema

* Remove LogoutOption param of unit tests and steps

* Fix unit test

* Fix unit test CF ReadServiceKey

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
2020-07-23 10:26:50 +02:00
Chris Bo
6b6d1bc087
gCTS docu fixes (#1823)
* docu fixes

* regenerated

* convert double to single quotes

* outline placeholders

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

* outline placeholders

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

* outline placeholders

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

* outline placeholders

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

* regenerated

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-07-22 10:56:20 +02:00
lndrschlz
94dba13fef
fix(checkmarxExecuteScan): whitespace in filePatterns; log output; (#1784)
* removed whitespaces in filePatterns and add zip file count log

* safer string-replace for whitespaces

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-07-20 16:50:48 +02:00
lndrschlz
42f91f6ff1
checkmarxExecuteScan: added resourceRef for secrets in step yaml (#1767)
* checkmarxExecuteScan: added resourceRef for secrets in step yaml

* regenerate stepmeta

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-07-20 15:44:24 +02:00
Kevin Hudemann
58e7e4be44
Add buildDescriptorExcludeList parameter to npmExecuteScripts step (#1800)
This change adds a buildDescriptorExcludeList parameter to
npmExecuteScripts, to enable the exclusion of certain directories when
executing npm scripts. Previously, npmExecuteScripts could only execute
scripts in all packages.

Now it is possible to provide paths or patterns as elements of the
buildDescriptorExcludeList to exclude packages when executing npm scripts.
2020-07-16 17:16:55 +02:00
Marcus Holl
8af0540de2
Introduce chmod in file utils (#1808) 2020-07-16 14:25:01 +02:00
Oliver Nocon
43f51ba90a
Revamp documentation generation for golang steps (#1781)
* Revamp documentation generation for golang steps

* Add and update tests

* Add tests, add step outputs

* Add tests, add step outputs

* Update rendering

* fix merge conflict

* update generated files

* Update pkg/config/stepmeta.go

* Update pkg/config/stepmeta.go

* Update pkg/generator/helper/docuHelper.go

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

* Include PR feedback

* update tests

* Fix Jenkins dependecy indication

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-07-16 09:10:15 +02:00
Chris Bo
9558b47268
Introducing new step 'gctsExecuteABAPUnitTests' (#1532)
* add new step 'gctsExecuteABAPUnitTests'

* added new step entries

* small wording improvement

* regenerated

* fixed unit tests

* adjusted prerequisites

* removed telemetry

* remove command

* moved functions to http package

* newly generated

* remove commented code

* use credentials ID in config.yaml

* add supported protocols to docu

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-07-14 10:58:57 +02:00
Marcus Holl
bda9a9ffba
Dont work upon a global command.Command instance inside cloudfoundry package (#1771)
o Up to now we work on a private and shared instance of command.Command inside
  the cloudfounrdy package. We need to be able either configure this instance
  (environment variables) according to the use case. One option is to hand over
  an already configured instance which is used elsewhere. This is what we do with
  this commit.

o With this commit we remove the instance which is shared within the cloudfounrdy
  package and to provide an instance with a receiver which gets handed over to the
  functions. Hence we are thread save: parallel invoctation of e.g. Login will not
  affect each other.
2020-07-10 16:31:17 +02:00
lndrschlz
db13b2f9ce
moved container context method to config package and expose for reuse (#1770) 2020-07-10 10:32:26 +02:00
Oliver Nocon
111e4de8c3
kanikoExecute - golang version (#1765)
* kanikoExecute golang version

* update entrypoint

* update entrypoint

* update entrypoint

* update entrypoint

* update entrypoint

* add command

* include PR feedback

* remove trailing spaces

* remove defaults for certificates

* Update generated file
2020-07-10 08:07:59 +02:00
Daniel Kurzynski
fbf2b29a32
NpmExecuteScripts add script options (#1780) 2020-07-09 14:57:41 +02:00
MuellerHenrik
bdd1e89497
Replace %w with %v for Warnf (#1774)
Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
2020-07-09 12:04:09 +02:00
Daniel Kurzynski
15926684cb
Fix lint tests (#1773)
Co-authored-by: Kevin Hudemann <kevin.hudemann@sap.com>
2020-07-08 11:57:21 +02:00
Dominik Lendle
509607f69f
Host parameter fix (#1752) 2020-07-07 16:19:57 +02:00
Marcus Holl
4f2ba73314
[refactoring] move the shell/command related interfaces into pkg/command (#1737)
* [refactoring] move the shell/command related interfaces into pkg/command

otherwise we are not able to use the corresponding mocks for the items contained in pkg since
these interfaces are not visible from the pkg folder

Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-07-01 11:28:16 +02:00
Jordan Levin
34967c502c
Whitesource scan (MVP) (#1658)
* Whitesource MVP for Gradle, Golang, and NPM/Yarn

* Refactoring

* Refactor and cleanup, better error checking

* publish stepResults, use pkg/versioning, bubble up errors, add gomod versioning support

* Run gofmt and cleanup comments

* Resolve PR comments

* Update resources/metadata/whitesource.yaml

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

* Only determine project coordinates if they are missing

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* Gradle versioning artifact

* fix gradle artifact version regexp and refactor

* Fix token extraction from output buffer

* Fix some issues with pip and jsonfile versioning logic

* Remove useless spacing

* Remove unnecessary test file and fix naming style for JSONDescriptor

* Automatically download wss-unified-agent if file does not exist

* adds downloadVulnerabilityReport, checkSecurityViolations, minor refactoring

* adds config.ReportDirectoryName, improves readability

* Version-wide reporting for vulnerabilities and list of libraries.

* Refactor and improve build accuracy

* fix sed command

* Add includes file pattern config option

* Adds --exclude command line flag

* run go mod tidy and regenerate step framework

* Fix unit tests

* revert changes

* poll project status before downloading reports

* merge with master

* go mod tidy, go fmt, and fix whitesource unit test

* sync go.mod

* sync go.mod again

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-07-01 07:54:13 +02:00
MuellerHenrik
de3afe9476
Change parameters/alias for CfServiceKeyName (#1726)
* Fix alias cfServiceKeyName

* Adapt documentation

* Fix alias use in go files

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
2020-06-30 15:46:07 +02:00
Oliver Nocon
ac5ae40ecb
kubernetesDeploy: categorize known errors & fix #1732 (#1727)
* kubernetesDeploy: categorize known errors

* hide Docker secret in log output
2020-06-30 10:48:30 +02:00
Oliver Nocon
54850d2ca0
sonarExecuteScan: add error categorization (#1715) 2020-06-26 07:38:27 +02:00
Oliver Nocon
bb8cd30c4c
Extend resource references to cater for secrets (#1718)
* Add secret references to step metadata

* Update references

* update generated files
2020-06-25 16:33:38 +02:00
andre2007
f0babcade1
feat(sonar): upgrade sonar-scanner-cli to 4.4.0.2170 (#1710)
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-06-25 13:53:22 +02:00
Oliver Nocon
eafe383d54
Add error category parsing to cmd execution (#1703)
* Add error category parsing to cmd execution

It is now possible to define `ErrorCategoryMapping` as a `map[string][]string` on a `Command`.
The format contains the category as key which has a list of error patterns assigned.
Example:

```
cmd := Command{
  ErrorCategoryMapping: map[string][]string
    "build": {"build failed"},
    "compliance": {"vulnerabilities found", "outdated components found"},
    "test": {"some tests failed"},
  },
}
```

Setting this map triggers console log parsing when executing a command.
If a match is found the error category is stored and
it will automatically be added to the `errorDetails.json`.

* clean up go.mod

* fix test

* fix test

* Update DEVELOPMENT.md

* fix tests

* address long console content without line breaks

* scan condition update

* fix test

* add missing comment for exported function

* Update pkg/command/command.go

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-06-24 10:04:05 +02:00
Christopher Fenner
c42553593e
fix: remove unused variables from generated step coding (#1698)
* remove unused parameters from generated code

* update steps

* update steps

* correct golden files

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-06-23 18:05:21 +02:00
Florian Wilhelm
60eefabb20
Install dev deps in mta build (#1685)
Ensure npm dev dependencies are available after mtaBuild as they are required by certain tests.
Co-authored-by: Kevin Hudemann <kevin.hudemann@sap.com>
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-06-22 10:39:52 +02:00
Kevin Hudemann
60fa1d5bbf
Add Java-/Typescript linting capabilities (#1636)
This change adds linting support for Java-/TypeScript projects based on the checkDefaultLint and checkUserLint steps from Cloud SDK Pipeline.

Following options are supported:

1. Define a linting script named ci-lint in the package.json file(s) of the project
2. Provide a configuration for ESLint as part of the project
3. If none of the above: ESLint is executed with a general purpose configuration.

Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-06-22 10:12:28 +02:00
Oliver Nocon
d8444d51f2
Add possibility to add category to failures (#1692)
* Add possibility to add category to failures

It is now possible to set the error category within the flow.
When exiting the program the error category can be used.

There is  a convenience function available for exiting with a previously set category,
for example

```
log.SetErrorCategory(log.ErrorCompliance)
...
log.FatalError(err, "configuration error")
```

* extend test

* go mod tidy

* add missing comment

* update information about error categories

* Update DEVELOPMENT.md
2020-06-22 08:21:38 +02:00
Daniel Kurzynski
8f9ed0766c
Let json patcher fail if file not found (#1694)
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-06-19 20:13:20 +02:00
Daniel Kurzynski
7c441f552f
Make version command a high level command like get-config without resolving the configuration (#1689) 2020-06-19 14:39:19 +02:00
Kevin Hudemann
ceb3dd0a04
Refactor pkg/npm and npmExecuteScripts (#1684)
This change refactors the npm pkg and npmExecuteScripts implementations
to be reusable for future steps, e.g., npmExecuteLint.

In addition, it fixes few small bugs related to unit test execution on
Windows and the fileUtils mocking implementation.

Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-06-18 17:30:17 +02:00
Daniel Kurzynski
be01dd3869
Add schema patch step in go (#1683)
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-06-18 14:50:46 +02:00
Chris Bo
e9ad8c5e9c
Introducing new step 'gctsCloneRepository' (#1468)
* added new step gctsCloneRepository

* enhanced docu

* adjusted test case name

* enhanced docu

* refined error messages

* regenerated & remove unused Groovy imports

* small change

* remove execRunner

* Update documentation/docs/steps/gctsCloneRepository.md

* regenerated

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-06-18 07:45:22 +02:00
Daniel Kurzynski
743fca43e1
Remove projectVersion from fortify documentation (#1628)
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-06-17 17:47:59 +02:00
Daniel Kurzynski
0222bf83d1
Run npm scripts in virtual frame buffer and extend command.go to run executable asynchronously (#1669)
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Florian Wilhelm <florian.wilhelm02@sap.com>
2020-06-16 11:42:51 +02:00
Dominik Lendle
0fd9c4be84
cf create/delete service: Changing to workingDir (#1560)
* minor changes

* Changed yaml with aliases

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* Changed yaml aliases

* Adapted naming conventions

* Removed error code at the end

* Adapted configuration

* Minor changes

* Minor changes

* Minor changes

* Removed spaces

* Removed docker-related config from groovy file

* Minor changes

* Minor changes

* Removed container config

* Corrected testing function name

* Deleted unnecessary parts

* Changed service deletion message

* Changed service deletion message

* Logging out before throwing error service deletion step fails

* Minor changes

* Minor changes

* Minor changes

* Delete .DS_Store

* Delete .DS_Store

* Delete .DS_Store

* Delete .DS_Store

* Minor changes

* Minor changes

* Minor changes

* Added newline at end of file

* Added newline at end of file

* Changes for Pull request optimization

* added documentaion

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Added CFDeleteServiceKeys

* Added ServiceKey deletion tests

* added cfServiceKeys flag explanation to documentation

* removed trailing spaces from documentation

* resolving conflicts

* Changed deletion message an variable naming

* Changed tests

* Changed tests

* Changed tests

* Changed tests

* Changed CloudFoundryDeleteServiceOptions to options

* Changed CloudFoundryDeleteServiceOptions to options

* Minor changes

* Minor changes

* Changed variable naming

* Changed error handling

* Changed error handling and logging

* Changed documentation

* Simplified code

* Fixed CodeClimate issues

* Changed from returning err to nil where no errur returned needed

* Add cloudFoundryCreateServiceKey Go Step

* Changed Groovy File

* Changed aliases

* Removed unneccessary parts

* Minor changes

* Minor changes

* Adapted documentation

* Adapted tests

* Adapted Groovy File

* Changed Groovy file

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Removed Groovy Tests for cfCreateServiceKey

* Minor changes

* Added ATC Check YAML

* Added ATC Check generated files

* Added test class

* Added abapEnvironmentRunATCCheck

* Minor changes

* Minor changes

* Changed groovy

* Minor changes

* Changed groovy

* Changed groovy

* Minor changes

* Adapted Groovy imports

* Adapted Groovy imports

* Adapted Groovy imports

* Adapted Groovy

* Getting ATC results

* Changed error message

* changed groovy

* removed trailing spaces

* Added login check

* Minor changes

* Added step to whitelistScriptReference

* Added ATC error message handling

* Added groovy file

* Added step to groovy tests

* corrected metadata file

* Debugging

* Debugging

* Added yaml config parameter for ATC run

* Adapted file location of ATC run config to jenkins specific location

* Implementing universal pipeline logic for finding yaml config regardless of pipeline

* Changed error handling for reading config yaml file

* Changed atcrunconfig alias

* minor changes

* Minor changes

* Minor changes

* Changed back to dynamic file reading

* Minor changes

* filepath changes

* Removing CF Login

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Removed whitespaces

* Added CF functions unit tests

* Added invalid parameter handling

* Removed package and SC flag

* Minor changes

* Changed tests

* Changed tests

* Changed tests

* Minor changes

* Changed tests

* removed unnecessary logout

* Added documentation

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Removed trailing spaces

* Added newline at end of file

* code climate fixes

* code climate fixes

* code climate fixes

* Minor changes

* Minor changes

* Minor changes

* Changed tests

* Test changes

* Splitted Cloud Foundry functions into two classes

* Removed two steps from whtielistScriptReference

* removed atcrunConfig alias

* issue fixes

* Changed docu

* Changed docu

* Changed docu

* Removed trailing spaced from docu

* Changed docu

* Go generator run

* Issue fixes

* Remove unnecessary imports

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

* Update whitelistScript

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

* Adding piperutils for writing xml file

* Persisting ATC Results with piperutils

* Set failonMissingReports to true

* Refactoring for CodeClimate

* Changed result file name

* Changed credentials aliases

* changing secret name

* Removing trailing spaces

* Added secret name and alias to docu

* Changing to workingDir

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-06-15 21:31:50 +02:00
lndrschlz
48f6a08433
GithubPublishRelease: Add "pre-release" flag (#1654)
* githubPublishRelease: added prerelease tag

* test case added

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-06-15 21:05:08 +02:00
Florian Wilhelm
0fcf1654fe
Install maven artifacts after mta build (#1641)
Extend mta build step to install maven artefacts after build to allow re-using them in later stages (additional unit or integration tests which might not be running as part of the "build" life-cycle).
2020-06-15 12:46:54 +02:00
Stephan Aßmus
f855658e06
Enhance piperutils.Files and mock.FilesMock (#1664)
* Flesh out piperutils.Files and mock.FilesMock functionality
* Avoid a lot of code-duplication via embedding
2020-06-15 09:47:33 +02:00
Daniel Kurzynski
41c1653a06
Fix checkmarx (#1655) 2020-06-12 09:22:22 +02:00
Stephan Aßmus
d558db9106
Refactor maven.Evaluate() to take options (#1659)
Co-authored-by: Florian Wilhelm <florian.wilhelm02@sap.com>
2020-06-11 14:02:54 +02:00
Christopher Fenner
8e78199cce
chore: emit used project config & defaults to log (#1633)
* print used project config

* print used project defaults
2020-06-10 09:39:29 +02:00
Stephan Aßmus
56699ab019
Run artifactPrepareVersion in maven container if necessary (#1634)
* The metadata for artifactPrepareVersion-go specifies a container for when the buildTool is maven.
* The alias to 'mavenExecute' was removed. The problem with this is that when a section containers is included in the metadata, dockerImage will always be picked up from mavenExecute, the conditional dependency on buildTool will not even be considered. Parameters such as m2Path, projectSettingsFile and globalSettingsFile should be configured in general/maven if necessary.
* When the step ends up being executed within dockerExecuteOnKubernetes, we need to preserve the .git folder. This folder would normally be excluded by the default excludes of the stash step. There was already a comment that suppressing this behavior by passing useDefaultExcludes: false was problematic (unfortunately without going into details), so I've added a new parameter to dockerExecute and dockerExecuteOnKubernetes named stashNoDefaultExcludes (note the reverted meaning to ease preserving the default behavior when this parameter is not provided). This parameter is passed to piperExecuteBin from the artifactPreferVersion groovy wrapper.
2020-06-08 17:08:05 +02:00
Marcus Holl
0ad38b8621
Timeout for malwarescan (#1623)
Provide a timeout parameters to malwarescan step. This is forwarded to the piper http layer. The default used there is 10 seconds with is not useable for that use case for larger files.
2020-06-03 11:08:34 +02:00
Daniel Kurzynski
cf9a41850e
Needed CLI separator for Fortify tools depends on platform (#1616)
* Update fortify.yaml
* src, exclude and pythonAdditionalPaths are now lists of strings
* Re-implement pythonIncludes and pythonExcludes as aliases of src and exclude
* Fix using the correct separator (; on windows, : on everything else)
* Tokenize also python "includes"
* mvnCustomArgs was removed

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-06-02 13:47:07 +02:00
Stephan Aßmus
a24a7aad23
Fortify: Using mvn to auto-resolve classpath needs additional params (#1607)
* also reduce code duplication in token fetching
* concatenate classpaths from multi-maven projects

Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-05-29 15:42:35 +02:00
Daniel Mieg
6db5beb2ec
Increase timeout (#1609)
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-05-28 13:08:26 +02:00
Daniel Kurzynski
0a4309a2c2
Add build project name (#1610)
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-05-28 10:45:06 +02:00
Maximilian Lenkeit
10e5bf98f8
artifactPrepareVersion: remember original artifact version (#1600)
* Update resources.go

* expose originalArtifactVersion parameter

* re-generate steps

* adjust golden files for generator changes
2020-05-28 10:05:22 +02:00
Florian Wilhelm
0857c9a3c6
Allow custom options for src, exclude in fortify translate (#1592)
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Kevin Hudemann <kevin.hudemann@sap.com>
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-05-27 11:45:01 +02:00
Oliver Nocon
d5d510719d
piperExecuteBin - prevent non-speaking exit code 1 error (#1584)
* piperExecuteBin - prevent non-speaking exit code 1 error

Make sure that error during context resolution gets more context.

* properly provide golang errors

* improve error message, when no details are available

* Add error category

* Update getConfig.go
2020-05-26 07:58:03 +02:00
lndrschlz
80f70aba4a
Error reporting: change category to standard term (#1587)
* streamlined error category with standard term

* remove unused import from test

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-05-25 22:38:26 +02:00
Sven Merk
af2a01c064
Fortify implementation in golang (#1428) 2020-05-25 19:48:59 +02:00
Oliver Nocon
f92771003c
detectExecuteScan - switch off phone home (#1582) 2020-05-25 09:44:42 +02:00
Florian Wilhelm
bd1e0a1071
Fix npm registry config (#1564) 2020-05-20 13:41:23 +02:00
Oliver Nocon
a0ded365c5
Fix container condition handling (#1562)
* Add additional tests
* Update handling of containers
* Properly consider existing config at root level
* Fix parameter filtering
* Fix tests for adapted filter handling
2020-05-20 10:50:35 +02:00
Stephan Aßmus
ac122a84e7
Fix mtarName config param handling (#1570) 2020-05-19 22:02:47 +02:00
Florian Wilhelm
550651187d
Configure alias for extension (#1569)
Restore compatibility with old parameter name to avoid breaking changes.



Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-05-19 17:05:11 +02:00
Marcus Holl
f47f2e6e90
Use mtaBuild step from go (#1536)
Co-authored-by: Your Name <kevin.hudemann@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-05-19 08:51:18 +02:00
Oliver Nocon
7f7d0bce89
Piper steps: Issue SUCCESS message (#1478)
* Piper steps: Issue SUCCESS message

Log `SUCCESS` message in all steps by default if no error occured

* Update additional generated steps

* Update generated step
2020-05-18 21:52:54 +02:00
Chris Bo
abdc3f736b
Introducing new step 'gctsDeployCommit' (#1476)
* added new step gctsDeployCommit

* suggested PR fixes applied

* fixed test

* Remove unused imports

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

* added URL encoding for 'request' parameter

* regenerate after change

* minor changes

* renamed step to 'gctsDeploy'

* changed name

* remove space

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

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-05-18 21:39:35 +02:00
Dominik Lendle
4a82eb5aaa
Docu changes to abapEnvironmentRunATCCheck step (#1557)
* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* Changed yaml aliases

* Adapted naming conventions

* Removed error code at the end

* Adapted configuration

* Minor changes

* Minor changes

* Minor changes

* Removed spaces

* Removed docker-related config from groovy file

* Minor changes

* Minor changes

* Removed container config

* Corrected testing function name

* Deleted unnecessary parts

* Changed service deletion message

* Changed service deletion message

* Logging out before throwing error service deletion step fails

* Minor changes

* Minor changes

* Minor changes

* Delete .DS_Store

* Delete .DS_Store

* Delete .DS_Store

* Delete .DS_Store

* Minor changes

* Minor changes

* Minor changes

* Added newline at end of file

* Added newline at end of file

* Changes for Pull request optimization

* added documentaion

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Added CFDeleteServiceKeys

* Added ServiceKey deletion tests

* added cfServiceKeys flag explanation to documentation

* removed trailing spaces from documentation

* resolving conflicts

* Changed deletion message an variable naming

* Changed tests

* Changed tests

* Changed tests

* Changed tests

* Changed CloudFoundryDeleteServiceOptions to options

* Changed CloudFoundryDeleteServiceOptions to options

* Minor changes

* Minor changes

* Changed variable naming

* Changed error handling

* Changed error handling and logging

* Changed documentation

* Simplified code

* Fixed CodeClimate issues

* Changed from returning err to nil where no errur returned needed

* Add cloudFoundryCreateServiceKey Go Step

* Changed Groovy File

* Changed aliases

* Removed unneccessary parts

* Minor changes

* Minor changes

* Adapted documentation

* Adapted tests

* Adapted Groovy File

* Changed Groovy file

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Removed Groovy Tests for cfCreateServiceKey

* Minor changes

* Added ATC Check YAML

* Added ATC Check generated files

* Added test class

* Added abapEnvironmentRunATCCheck

* Minor changes

* Minor changes

* Changed groovy

* Minor changes

* Changed groovy

* Changed groovy

* Minor changes

* Adapted Groovy imports

* Adapted Groovy imports

* Adapted Groovy imports

* Adapted Groovy

* Getting ATC results

* Changed error message

* changed groovy

* removed trailing spaces

* Added login check

* Minor changes

* Added step to whitelistScriptReference

* Added ATC error message handling

* Added groovy file

* Added step to groovy tests

* corrected metadata file

* Debugging

* Debugging

* Added yaml config parameter for ATC run

* Adapted file location of ATC run config to jenkins specific location

* Implementing universal pipeline logic for finding yaml config regardless of pipeline

* Changed error handling for reading config yaml file

* Changed atcrunconfig alias

* minor changes

* Minor changes

* Minor changes

* Changed back to dynamic file reading

* Minor changes

* filepath changes

* Removing CF Login

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Removed whitespaces

* Added CF functions unit tests

* Added invalid parameter handling

* Removed package and SC flag

* Minor changes

* Changed tests

* Changed tests

* Changed tests

* Minor changes

* Changed tests

* removed unnecessary logout

* Added documentation

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Removed trailing spaces

* Added newline at end of file

* code climate fixes

* code climate fixes

* code climate fixes

* Minor changes

* Minor changes

* Minor changes

* Changed tests

* Test changes

* Splitted Cloud Foundry functions into two classes

* Removed two steps from whtielistScriptReference

* removed atcrunConfig alias

* issue fixes

* Changed docu

* Changed docu

* Changed docu

* Removed trailing spaced from docu

* Changed docu

* Go generator run

* Issue fixes

* Remove unnecessary imports

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

* Update whitelistScript

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

* Adding piperutils for writing xml file

* Persisting ATC Results with piperutils

* Set failonMissingReports to true

* Refactoring for CodeClimate

* Changed result file name

* Changed credentials aliases

* changing secret name

* Removing trailing spaces

* Added secret name and alias to docu

* Docu changes

* CodeClimate fixes

* Minor docu changes

* Correct syntax highlighting

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Daniel Mieg <daniel.mieg@sap.com>
2020-05-18 12:49:52 +02:00
Stephan Aßmus
5f48d4d767
Execute test in temp folder (#1561) 2020-05-18 10:31:38 +02:00
Oliver Nocon
d5bff20b10
Create step to save container image (#1554)
* Create step to save container image

* add error handling for directory creation

* Update permissions

* remove indirection and add tests

* finalize tests

* Fix test to also run on linux environments

* Update cmd/containerSaveImage.go

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* Update resources/metadata/savecontainer.yaml

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* Update cmd/containerSaveImage.go

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* Update cmd/containerSaveImage_test.go

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* Update generated file

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-05-18 08:55:25 +02:00
Florian Wilhelm
d151550554
Allow to configure sap npm registry in mta builder (#1550) 2020-05-15 14:20:37 +02:00
Christopher Fenner
f9be21900e
fix(versioning): commit only modified files (#1549)
* add only modified files

* adjust tests

* remove mock add
2020-05-14 17:20:13 +02:00
Daniel Mieg
194d711e84
Adapt config for abapEnvironmentPullGitRepo, cloudFoundryCreateServiceKey and cloudFoundryDeleteService (#1520)
* Enable multiple repositories

* Improve readability

* Adapt documentation

* rerun generator

* Add initial info line

* Improve logging

* Enable configuration in GENERAL section

* Adapt yml abapEnvironmentPullGitRepo

* Add aliases for crendetialsId

* Change order of credentialsId aliases

* Change prio of different names of credentialsId

* Add docu to sidebar
2020-05-14 14:48:12 +02:00
Christopher Fenner
27c6320474
feat(sonar): write flag for sonar execution to influx (#1534)
* write flag for sonar execution to influx

* add missing step metadata file

* first attempt to read influx from disk

* add missing import

* correct glob pattern

* use file path

* correct type names

* cleanup

* fix code climate issue

* fix typo

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* add test case

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-05-14 13:46:40 +02:00
Stephan Aßmus
5ab4dedcb2
Optionally ignore custom defaults (#1538)
* Add parameter "--ignoreCustomDefaults"
* Pass to piper customDefaults from config also via --defaultConfig
... and add "--ignoreCustomDefaults".
* Log output when ignoring customDefaults

Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-05-14 10:50:58 +02:00
dominiklendle
ac732b3065
Add abapEnvironmentRunATCCheck step (#1454)
* Minor changes

* Changed groovy file

* Changed generated file

* Changed yaml with container config

* Changed groovy config

* minor changes

* minor changes

* Changed yaml with aliases

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* minor changes

* Changed yaml aliases

* Adapted naming conventions

* Removed error code at the end

* Adapted configuration

* Minor changes

* Minor changes

* Minor changes

* Removed spaces

* Removed docker-related config from groovy file

* Minor changes

* Minor changes

* Removed container config

* Corrected testing function name

* Deleted unnecessary parts

* Changed service deletion message

* Changed service deletion message

* Logging out before throwing error service deletion step fails

* Minor changes

* Minor changes

* Minor changes

* Delete .DS_Store

* Delete .DS_Store

* Delete .DS_Store

* Delete .DS_Store

* Minor changes

* Minor changes

* Minor changes

* Added newline at end of file

* Added newline at end of file

* Changes for Pull request optimization

* added documentaion

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Adapted documentation

* Added CFDeleteServiceKeys

* Added ServiceKey deletion tests

* added cfServiceKeys flag explanation to documentation

* removed trailing spaces from documentation

* resolving conflicts

* Changed deletion message an variable naming

* Changed tests

* Changed tests

* Changed tests

* Changed tests

* Changed CloudFoundryDeleteServiceOptions to options

* Changed CloudFoundryDeleteServiceOptions to options

* Minor changes

* Minor changes

* Changed variable naming

* Changed error handling

* Changed error handling and logging

* Changed documentation

* Simplified code

* Fixed CodeClimate issues

* Changed from returning err to nil where no errur returned needed

* Add cloudFoundryCreateServiceKey Go Step

* Changed Groovy File

* Changed aliases

* Removed unneccessary parts

* Minor changes

* Minor changes

* Adapted documentation

* Adapted tests

* Adapted Groovy File

* Changed Groovy file

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Removed Groovy Tests for cfCreateServiceKey

* Minor changes

* Added ATC Check YAML

* Added ATC Check generated files

* Added test class

* Added abapEnvironmentRunATCCheck

* Minor changes

* Minor changes

* Changed groovy

* Minor changes

* Changed groovy

* Changed groovy

* Minor changes

* Adapted Groovy imports

* Adapted Groovy imports

* Adapted Groovy imports

* Adapted Groovy

* Getting ATC results

* Changed error message

* changed groovy

* removed trailing spaces

* Added login check

* Minor changes

* Added step to whitelistScriptReference

* Added ATC error message handling

* Added groovy file

* Added step to groovy tests

* corrected metadata file

* Debugging

* Debugging

* Added yaml config parameter for ATC run

* Adapted file location of ATC run config to jenkins specific location

* Implementing universal pipeline logic for finding yaml config regardless of pipeline

* Changed error handling for reading config yaml file

* Changed atcrunconfig alias

* minor changes

* Minor changes

* Minor changes

* Changed back to dynamic file reading

* Minor changes

* filepath changes

* Removing CF Login

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Removed whitespaces

* Added CF functions unit tests

* Added invalid parameter handling

* Removed package and SC flag

* Minor changes

* Changed tests

* Changed tests

* Changed tests

* Minor changes

* Changed tests

* removed unnecessary logout

* Added documentation

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Changed docu

* Removed trailing spaces

* Added newline at end of file

* code climate fixes

* code climate fixes

* code climate fixes

* Minor changes

* Minor changes

* Minor changes

* Changed tests

* Test changes

* Splitted Cloud Foundry functions into two classes

* Removed two steps from whtielistScriptReference

* removed atcrunConfig alias

* issue fixes

* Changed docu

* Changed docu

* Changed docu

* Removed trailing spaced from docu

* Changed docu

* Go generator run

* Issue fixes

* Remove unnecessary imports

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

* Update whitelistScript

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

* Adding piperutils for writing xml file

* Persisting ATC Results with piperutils

* Set failonMissingReports to true

* Refactoring for CodeClimate

* Changed result file name

* Changed credentials aliases

* changing secret name

* Removing trailing spaces

* Added secret name and alias to docu

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-05-13 14:51:48 +02:00
Daniel Mieg
02ede6d28b
feat!: Mass enable abapEnvironmentPullGitRepo (#1516)
* Enable multiple repositories

* Improve readability

* Adapt documentation

* rerun generator

* Add initial info line

* Improve logging
2020-05-07 15:51:11 +02:00
Sven Merk
911b8bfb26
Add resolution and storage of commit message (#1515)
* Add commit message

* Add ToDo for later refctoring
2020-05-07 11:21:29 +02:00
Oliver Nocon
f7fdd79fa7
artifactPrepareVersion: additional options (#1512)
* artifactPrepareVersion: additional options

it is now possible to use
* a Unix timestamp number
* a short commit hash

* Add dedicated Docker versioning scheme
2020-05-06 22:07:27 +02:00
Florian Wilhelm
eaf5479e9c
Fix maven parameter handling (#1493)
Avoid maven error `Unknown lifecycle phase \"-\"` when the value of a define contains `-`.

Don't split and trim maven arguments. Expect they come in as a list, keep them as list.

This is a breaking change compared to the old Groovy implementation which relied on using a shell for calling maven.

As an example, consider this diff:

```diff
-        goals: 'org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate',
-        defines: "-Dexpression=$pomPathExpression -DforceStdout -q",
+        goals: ['org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate'],
+        defines: ["-Dexpression=$pomPathExpression", "-DforceStdout", "-q"],
```
2020-05-06 17:43:32 +02:00
Christopher Fenner
e4f827118b
refactor(protecode): handle DOCKER_CONFIG in go (#1502)
* handle DOCKER_CONFIG in go

* cleanup

* always use parent dir

* take care of errors
2020-05-06 16:07:10 +02:00
Stephan Aßmus
082b249cc0
Fix logrus buffer issue (#1511) 2020-05-06 13:35:40 +02:00
Florian Wilhelm
0a196af04c
Allow configuration of log format, change default to fixed-width (#1432) 2020-05-06 12:17:56 +02:00
Marcus Holl
2c7c165e62
Malware scan metadata update (#1483) 2020-05-06 08:52:26 +02:00
Oliver Nocon
033ff8da6f
go: align used yaml package (#1504) 2020-05-05 15:54:50 +02:00
lndrschlz
39e30ff1b4
Added hook configuration; added sentry hook and tests (#1497)
* Added hook configuration; added sentry hook and tests
* steps generated by step framework
* added comments and renamed correlationID
* formatted comment on NewSentryHook method
* fix generator step tests
2020-05-05 08:36:24 +02:00
Hans Schulz
7c503d784b
fix dockerVersionSource not being used (#1492) 2020-04-30 17:32:18 +02:00
Chris Bo
6c32df0b89
Minor improvements to gctsCreateRepository step docu and metadata (#1469)
* fix docu

* enhanced step docu and metadata

* regenerate after changing metadata

* small wording change

Co-authored-by: Marcus Holl <marcus.holl@sap.com>
2020-04-29 16:21:55 +02:00
Oliver Nocon
363f69da29
Handle illegal verbose value (#1485)
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-04-29 15:05:00 +02:00
dominiklendle
b8eaa47230
Removing JSON config for Service Key Creation as in-line parameter (#1434)
* Issue fixes

* Removed Logging
2020-04-29 13:11:06 +02:00
Florian Wilhelm
7bbdaf783c
Dont dedup mvn flags (#1479) 2020-04-28 20:38:36 +02:00
Oliver Nocon
43947e6ef5
Pass golang error details to Jenkins pipeline (#1443)
Do not exit with os.Exit(1) but using log.Entry().Fatal() instead
* Golang: forward error details
* extend groovy wrapper to provide proper error message
* create closure for error handling
2020-04-28 07:42:02 +02:00
Kevin Hudemann
0be3225a3c
Enable the use of artifactPrepareVersion instead of artifactSetVersion (#1455)
This change enables the use of the artifactPrepareVersion go step instead
of the deprecated artifactSetVersion groovy implementation for the Cloud
SDK Pipeline. The groovy wrapper for the artifactPrepareVersion step now
enables the use of the download cache and minor issues are fixed.
2020-04-27 09:56:58 +02:00
Oliver Nocon
a728416e12
artifactPrepareVersion: define versioning scheme (#1457) 2020-04-24 20:52:16 +02:00
Florian Wilhelm
3f5b9cc555
Implement npmExecuteScripts step (#1422) 2020-04-24 18:29:30 +02:00
Chris Bo
fb4cfd84ec
Introducing new step: "gctsCreateRepository" (#1424)
With the step gctsCreateRepository it is possible to create a local gCTS repository on an ABAP server

Co-authored-by: Marcus Holl <marcus.holl@sap.com>
2020-04-24 15:31:41 +02:00
Daniel Kurzynski
974327d16e
Use mavenExecute from go (#1388)
Also establish mavenExecute() via new JenkinsMavenExecuteRule in Groovy Unit Tests.

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-04-24 10:41:49 +02:00
Arthur Lenz
b335387eac
feat(k8s): Add basic support for Helm 3 in kubernetesDeploy step (#1438)
* Extends kubernetesDeploy step to support Helm 3

Currently, the kubernetesDeploy step has no support to Helm 3 due to the fact that:
- the initialization command used works only for Helm 2
- the image used when running the helm CLI is based on Helm 2

The need for Helm 3 support comes from the fact that Helm 3 introduces major architectural changes,
more specifically, the removal of its server-side agent called Tiller - thus, being incompatible with
one another.

This commit adds this support by introducing a new configuration field (helmVersion).
By default, its values is set to 2 (Helm 2) to avoid breaking any existing functionalities.

* Use deployTool field to decide between Helm 2 or 3

* Remove helm init and replace wait for atomic in v3

* Update cmd/kubernetesDeploy.go

Nice catch!

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

* Add documentation for kubernetesDeploy step

* Add helm3 example for kubernetesDeploy step using mandatory fields

* Add new line at the end of kubernetesDeploy documentation

* Link kubernetesDeploy step with docs generator

* Add possible values for deployTool in kubernetesDeploy

* dummy change

* Revert "dummy change"

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-04-24 09:37:11 +02:00
Marcus Holl
b25079f862
Provide tooling for malware scanning (#1329)
Tooling for malwareScanning.

Co-authored-by: Stengel <r.stengel@sap.com>
2020-04-23 09:12:10 +02:00
Christopher Fenner
f655c07a92
fix(sonar): do not fail on missing task report file (#1436)
* fix(sonar): do not fail on missing task report file

* fix format
2020-04-21 22:47:38 +02:00
Christopher Fenner
989c47db2c
feat(sonar): extract sonar project link to report JSON (#1390)
* add test cases for sonar pkg

* add sonar pkg

* read task report and write reports JSON

* use alias

* rename type

* set read permission on created files

* archive reports

* handle empty report lists

* use filepath

* simplify report creation

* improve error message

* Revert "archive reports"

This reverts commit ba4b56fec1.

* improve test cases

* Add descriptions

Co-Authored-By: Stephan Aßmus <stephan.assmus@sap.com>

* improve tests

Co-Authored-By: Stephan Aßmus <stephan.assmus@sap.com>

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-04-21 15:45:52 +02:00
Oliver Nocon
75a10742d3
Step generator: correct error handling (#1429)
Do not exit with os.Exit(1) but using log.Entry().Fatal() instead
2020-04-20 16:52:57 +02:00
Oliver Nocon
3a9bc54711
protecodeExecuteScan - align user parameter (#1426)
align parameter name for scan user with other steps
2020-04-20 16:44:01 +02:00
Roland Stengel
5e2b2481c3
tests(sonar): fix test cases for windows (#1407)
* sonar: fix test cases

some unit tests uses path.Joint() instead of filepath.Join()
as the code does. on window these unit tests fail.

* missing newline

* Update cmd/sonarExecuteScan_test.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-04-17 15:01:22 +02:00
Stephan Aßmus
a09482a14f
Convert invalid config value types (#1408)
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-04-17 10:29:18 +02:00
Daniel Kurzynski
ce4be51362
Mask secrets (#1382) 2020-04-16 14:37:45 +02:00
Oliver Nocon
b9781ce50c
artifactPrepareVersioning: support more buildTools (#1367)
* artifactPrepareVersioning: support more buildTools
2020-04-15 13:12:43 +02:00
Christopher Fenner
70c000338f
fix: read config.yaml and config.yml in getConfig command (#1400) 2020-04-14 18:10:56 +02:00
Florian Wilhelm
b71ff0a055
Extend nexusUpload to also handle npm (#1379) 2020-04-11 12:56:44 +02:00
dominiklendle
66636d68f9
Hotfix for ServiceKey config parameter (#1377)
Changed from passing config as an array that was implemented badly to correct implementation that JSON config gets passed with ' '

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-04-09 16:57:50 +02:00
Christopher Fenner
c190deee44
refactor(sonar): switch to Sonar scan in GO (#1320)
* use sonar go in groovy

* use SONAR_TOKEN

* only use owner/repo if both are set

* trim version to major version digit

* fix code climate issues

* remove Sonar defaults

* use sonar go step

* use SONAR_TOKEN

* use certs from parameters

* use docker workspace & options

* add instance parameter

* implement branchName

* implement branchName

* remove duplicate default

* update docs

* fix TODOs

* remove merge mess

* fix code climate issue

* address comments

* respect custom defaults and custom config file name

* fix typo

* remove obsolete test cases

* disable CommonStepChecks

* check step config instead of context config

* remove TODOs

* respect jenkins PR envvars

* use value from stepConfig

* Update vars/sonarExecuteScan.groovy

* rename options to config

* correct type for options

* add test cases

* log sonar.options in debug message

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-04-08 12:55:46 +02:00
Daniel Mieg
bbaaef97ea
Include Transport & Execution Log in abapEnvironmentPullGitRepo() (#1347)
* Add logs and ABAP error messages

* Improve functions and tests

* Add improvements

* Further improvements

* Check for empty string for repositoryName

* Small adaptions

* Fix tests

* Add comments

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-04-08 12:43:41 +02:00
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