Skip to content

Commit

Permalink
chore: try to use sonarqube
Browse files Browse the repository at this point in the history
  • Loading branch information
alacambre-yseop committed Jul 12, 2019
1 parent f2b8f4f commit 29a0c22
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
31 changes: 28 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env groovy
@Library('Utilities') _

pipeline {
agent {
node {
Expand Down Expand Up @@ -27,9 +29,31 @@ pipeline {
sh "npm run package"
}
}
post {
success {
archiveArtifacts artifacts: 'vscode-yseopml-*.vsix', fingerprint: true
}
stage('SonarQube') {
steps {
script {
def scannerHome = tool 'sonarqube'
def sonarArgs = utils.constructSonarArgs(['develop', 'master'], 'develop')

withSonarQubeEnv('sonarcloud') {
sh "${scannerHome}/bin/sonar-scanner ${sonarArgs}"
}
}
}
}

stage('Sonar Quality Gate') {
when {
anyOf {
branch 'develop'
branch 'master'
}
}
steps {
timeout(time: 1, unit: 'HOURS') {
// Parameter indicates whether to set pipeline to FAILED if Quality Gate fails
waitForQualityGate abortPipeline: true
}
}
}
Expand All @@ -52,6 +76,7 @@ pipeline {
deleteDir()
}
success {
archiveArtifacts artifacts: 'vscode-yseopml-*.vsix', fingerprint: true
slackSend (color: 'good', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL}) <@${SLACK_NOTIFY}>")
}
failure {
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@
},
"scripts": {
"antlr4ts": "cd server && npm run antlr4ts",
"lint": "tslint -c tslint.json --project tsconfig.json '**/src/*.ts'",
"lint:report": "tslint --project tsconfig.json --force --fix -c tslint.json -o report.json -t json '**/src/*.ts'",
"tslint": "tslint -c tslint.json --project tsconfig.json '**/src/*.ts'",
"tslint:ci": "tslint --project tsconfig.json --force --fix -c tslint.json -o report.json -t json '**/src/*.ts'",
"vscode:prepublish": "npm run webpack",
"webpack": "npm run clean && webpack --mode production --config ./client/webpack.config.js && webpack --mode production --config ./server/webpack.config.js",
"webpack:dev": "npm run clean && webpack --mode none --config ./client/webpack.config.js && webpack --mode none --config ./server/webpack.config.js",
Expand All @@ -175,6 +175,7 @@
"merge-options": "^1.0.1",
"mocha": "^5.2.0",
"rimraf": "^2.6.3",
"sonar-scanner": "^3.1.0",
"ts-loader": "^5.4.5",
"tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0",
Expand Down

0 comments on commit 29a0c22

Please sign in to comment.