Skip to content
Open
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
44 changes: 28 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,34 @@ pipeline {
steps {
sh 'make distclean'
sh 'make SIMUATION=$COMPILER prep'
sh '''
mkdir -p .sonar
curl -sSLo .sonar/build-wrapper-linux-x86.zip ${SONARQUBE_URL}/static/cpp/build-wrapper-linux-x86.zip
unzip -o .sonar/build-wrapper-linux-x86.zip -d .sonar/
'''
}
}
stage('Build') {
steps {
sh 'make'
sh 'make install'
sh '.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output make && make install'
//sh '.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir build/ make install'
//sh 'make'
//sh 'make install'
}
}
stage('Static Code Analysis') {
when { anyOf {branch "release"; branch "test"; branch "sonarqube"} }
steps {
echo 'Perform static code analysis'
}
}
stage('Unit Testing') {
when { anyOf {branch "release"; branch "test"} }
steps {
echo 'make test'
}
}
stage('Coverage Testing') {
when { anyOf {branch "release"; branch "test"} }
steps {
echo 'make icov'
script {
def scannerHome = tool 'SonarScanner'; // Name of the SonarQube Scanner you created in "Global Tool Configuration" section
withSonarQubeEnv() {
sh "${scannerHome}/sonar-scanner-4.7.0.2747-linux/bin/sonar-scanner"
}
}
}
}
stage('Deploy') {
when { anyOf {branch "release"; branch "test"; branch "feature-*"; branch "dev-nathan"} }
when { anyOf {branch "release"; branch "test"; branch "feature-*"; branch "dev-nathan"; branch "sonarqube"} }
steps {
//sh 'scp -r build debian@192.168.8.24:/home/debian/nathan/lrm'
sshPublisher(
Expand Down Expand Up @@ -98,5 +98,17 @@ pipeline {
)
}
}
stage('Unit Testing') {
when { anyOf {branch "release"; branch "test"} }
steps {
echo 'make test'
}
}
stage('Coverage Testing') {
when { anyOf {branch "release"; branch "test"} }
steps {
echo 'make icov'
}
}
}
}
7 changes: 3 additions & 4 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
sonar.projectKey=sonarsource-cfamily-examples_linux-cmake-jenkins-sq
sonar.organization=sonarsource-cfamily-examples
sonar.projectVersion=1.0
# must be unique in a given SonarQube instance
sonar.projectKey=cFS

# SQ standard properties
sonar.sources=apps
sonar.sources=.

# Properties specific to the C and C++ analyzer:
sonar.cfamily.build-wrapper-output=bw-output