Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: enable sonarcloud checks #109

Merged
merged 1 commit into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 55 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 All @@ -18,12 +20,34 @@ pipeline {
}

stages {
stage ("Build, Compile, Test and Package") {
stage ("Install dependencies") {
steps {
ansiColor('xterm') {
sh "npm ci --unsafe-perm"
}
}
}

stage ("Compile") {
steps {
ansiColor('xterm') {
sh "npm install --unsafe-perm"
sh "npm run compile"
sh "npm run test"
}
}
}

stage ("Test") {
steps {
ansiColor('xterm') {
sh "npm run test:ci"
alacambre-yseop marked this conversation as resolved.
Show resolved Hide resolved
sh "npm run test:client"
}
}
}

stage ("Package") {
steps {
ansiColor('xterm') {
sh "npm run package"
}
}
Expand All @@ -33,6 +57,34 @@ pipeline {
}
}
}

stage('SonarQube') {
alacambre-yseop marked this conversation as resolved.
Show resolved Hide resolved
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
}
}
}
}

post {
Expand Down
11 changes: 11 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// babel.config.js
module.exports = {
presets: [
["@babel/preset-env", {
targets: {
node: "current",
},
}],
"@babel/preset-typescript",
],
};
Loading