-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathazure-ci.yaml
134 lines (117 loc) · 3.75 KB
/
azure-ci.yaml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: 7.$(DayOfYear)$(Rev:.rr)
pool:
demands: npm
steps:
- checkout: self
clean: true
persistCredentials: true
- script: |
git config user.email "ikemtz@outlook.com"
git config user.name "Isaac Martinez"
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- task: SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud'
inputs:
SonarCloud: 'SonarCloud IkeMtz'
organization: 'ikemtz'
scannerMode: CLI
configMode: manual
cliProjectKey: 'ikemtz_openapi-ts-generator'
cliProjectName: 'openapi-ts-generator'
cliSources: 'src'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
# sonar.exclusions=**/*.test.ts
sonar.sources=src
sonar.sourceEncoding=UTF-8
sonar.exclusions=**/node_modules/**,**/jest_ouput/**,**/*.spec.ts,jest.config.js
sonar.test.inclusions=**/*.spec.ts
sonar.ts.tslintconfigpath=tslint.json
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.typescript.lcov.reportPaths=coverage/lcov.info
sonar.eslint.reportPaths=eslint-report.json
sonar.typescript.exclusions=**/node_modules/**
- task: Npm@1
displayName: 'npm build'
inputs:
command: custom
verbose: false
customCommand: 'run build'
- task: Npm@1
displayName: 'npm test'
inputs:
command: custom
verbose: false
customCommand: 'run test'
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage cobertura-coverage.xml'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
failIfCoverageEmpty: true
- task: PublishTestResults@2
displayName: 'Publish JUnit Test Results'
inputs:
searchFolder: '$(System.DefaultWorkingDirectory)/coverage/'
testResultsFiles: junit.xml
mergeTestResults: true
failTaskOnFailedTests: true
- task: SonarCloudAnalyze@1
displayName: 'Run Code Analysis'
- task: SonarCloudPublish@1
displayName: 'Publish Quality Gate Result'
- task: sonarcloud-buildbreaker@2
displayName: 'Break build on SonarCloud quality gate failure'
inputs:
SonarCloud: 'SonarCloud IkeMtz'
organization: 'ikemtz'
- task: SnykSecurityScan@0
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
serviceConnectionEndpoint: 'synk'
testType: 'app'
severityThreshold: 'medium'
monitorOnBuild: false
failOnIssues: false
projectName: 'openapi-ts-generator'
organization: 'ikemtz'
testDirectory: '$(Build.SourcesDirectory)'
- task: Npm@1
displayName: 'npm prep:lib'
inputs:
command: custom
verbose: false
customCommand: 'run prep:lib'
- task: Bash@3
displayName: 'running versioneer'
inputs:
filePath: '$(System.DefaultWorkingDirectory)/versioneer.sh'
arguments: '$(Build.BuildNumber)'
workingDirectory: '$(System.DefaultWorkingDirectory)/lib/'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: prod-drop [RELEASE BUILD]'
inputs:
PathtoPublish: 'lib'
ArtifactName: 'release-drop'
- task: GitTag@5
inputs:
workingdir: '$(SYSTEM.DEFAULTWORKINGDIRECTORY)'
tagUser: 'ikemtz'
tagEmail: 'ikemtz@outlook.com'
tag: 'oapi-$(Build.BuildNumber)'
tagMessage: 'oapi-$(Build.BuildNumber)'
useLightweightTags: true
conditions: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
trigger:
batch: true
branches:
include:
- master
pr:
branches:
include:
- master