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:
parent
3f1a9d004a
commit
30850aec2d
28
documentation/docs/steps/malwareExecuteScan.md
Normal file
28
documentation/docs/steps/malwareExecuteScan.md
Normal 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
|
||||
```
|
@ -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
|
||||
|
@ -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
|
||||
|
17
vars/malwareExecuteScan.groovy
Normal file
17
vars/malwareExecuteScan.groovy
Normal 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]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user