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

Add groovy wrapper for malwarescanning (#1403)

This commit is contained in:
Marcus Holl 2020-04-30 11:14:14 +02:00 committed by GitHub
parent 3f1a9d004a
commit 30850aec2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,28 @@
# ${docGenStepName}
## ${docGenParameters}
## ${docGenConfiguration}
## ${docJenkinsPluginDependencies}
## Exceptions
None
## Examples
```groovy
malwareExecuteScan script: this
```
configuration
```
steps:
malwareExecuteScan:
file: myFile.zip
host: https://malwarescanner.example.sap.com
credentialsId: MALWARESCAN
```

View File

@ -65,6 +65,7 @@ nav:
- karmaExecuteTests: steps/karmaExecuteTests.md
- kubernetesDeploy: steps/kubernetesDeploy.md
- mailSendNotification: steps/mailSendNotification.md
- malwareExecuteScan: steps/malwareExecuteScan.md
- mavenExecute: steps/mavenExecute.md
- mavenExecuteStaticCodeChecks: steps/mavenExecuteStaticCodeChecks.md
- mtaBuild: steps/mtaBuild.md

View File

@ -58,6 +58,7 @@ public class CommonStepsTest extends BasePiperTest{
'prepareDefaultValues',
'setupCommonPipelineEnvironment',
'buildSetResult',
'malwareExecuteScan', // go pattern, script not needed
'mavenExecuteStaticCodeChecks',
'cloudFoundryCreateServiceKey',
'gctsCreateRepository'
@ -133,6 +134,7 @@ public class CommonStepsTest extends BasePiperTest{
'cloudFoundryDeleteService', //implementing new golang pattern without fields
'cloudFoundryCreateServiceKey', //implementing new golang pattern without fields
'npmExecuteScripts', //implementing new golang pattern without fields
'malwareExecuteScan', //implementing new golang pattern without fields
'mavenBuild', //implementing new golang pattern without fields
'mavenExecute', //implementing new golang pattern without fields
'mavenExecuteStaticCodeChecks', //implementing new golang pattern without fields

View File

@ -0,0 +1,17 @@
import groovy.transform.Field
@Field String STEP_NAME = getClass().getName()
void call(Map parameters = [:]) {
handlePipelineStepErrors (stepName: STEP_NAME, stepParameters: parameters) {
def cred = [
type: 'usernamePassword',
id: 'malwareScanCredentialsId',
env: ['PIPER_user', 'PIPER_password']
]
piperExecuteBin parameters, STEP_NAME, "metadata/${STEP_NAME}.yaml", [cred]
}
}