forked from SaiDevOpsFaculty/SaiJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
84 lines (74 loc) · 2.11 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
84 lines (74 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
goals: 'package'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
- task: dependency-check-build-task@6
inputs:
projectName: 'SaiJavaCode'
scanPath: '/home/vsts/work/1/s/webapp/target'
format: 'HTML'
- task: SnykSecurityScan@1
inputs:
serviceConnectionEndpoint: 'snyk'
testType: 'app'
monitorWhen: 'always'
failOnIssues: false
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'sonarcloud'
organization: 'prajktamhapsekar829'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'prajktamhapsekar829'
cliProjectName: 'SaiJavaCode'
cliSources: '.'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
# sonar.exclusions=**/*.bin
sonar.java.binaries=.
- task: SonarCloudAnalyze@1
- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: '300'
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
goals: 'clean install'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
- task: CopyFilesOverSSH@0
inputs:
sshEndpoint: 'tomcat-devsecops-connection'
sourceFolder: '/home/vsts/work/1/s/webapp/target'
contents: '**/*.war'
targetFolder: '/var/lib/tomcat9/webapps'
readyTimeout: '20000'
- task: owaspzap@1
inputs:
threshold: '300'
scantype: 'targetedScan'
url: 'http://43.205.232.54:8080/SaiJavaCode'
provideCustomContext: true
contextPath: '/SaiJavaCode'