generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
55 lines (48 loc) · 1.85 KB
/
Jenkinsfile
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
@Library(['piper-lib-os']) _
node() {
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '5']]]);
stage('prepare') {
deleteDir()
checkout scm
setupCommonPipelineEnvironment script:this
}
stage('environment info') {
sh 'env'
}
stage ('tests') {
dockerExecute(
script: this,
dockerImage: 'cypress/browsers:node-20.13.0-chrome-124.0.6367.155-1-ff-125.0.3-edge-124.0.2478.80-1',
) {
sh '''chown -R root .
npm install
npm install start-server-and-test
npm run test
npm run cypress:ci
'''
}
//publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: false, reportDir: 'coverage/unit/lcov-report', reportFiles: 'index.html', reportName: 'Unit test coverage report'])
//publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: false, reportDir: 'coverage/cypress/lcov-report', reportFiles: 'index.html', reportName: 'End to end test coverage report'])
}
stage('SonarQube report') {
def scannerHome = tool 'cdc-tools-chrome-extension';
def nodeHome = tool 'nodejs16';
withEnv(["PATH=${nodeHome}/bin:${PATH}"]) {
withSonarQubeEnv('cdc-tools-chrome-extension') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
stage("SonarQube result") {
timeout(time: 30, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true,
credentialsId:"cdc-tools-chrome-extension-sonar"
}
}
stage('Mend/Whitesource report') {
whitesourceExecuteScan script: this
}
stage('Checkmarx report') {
checkmarxExecuteScan script:this
}
}