diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..a02f4278 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,78 @@ +pipeline { + agent any + tools { + maven 'Maven 3.3.9' + jdk 'jdk8' + } + stages { + stage('build') { + steps { + echo 'Khadijah' + sh 'ls' + } + } + + stage ('Initialize') { + steps { + sh ''' + echo "PATH = ${PATH}" + echo "M2_HOME = ${M2_HOME}" + ''' + } + } + + stage ('Build') { + steps { + sh 'mvn -Dmaven.test.failure.ignore=true install' + } + post { + success { + junit 'target/surefire-reports/**/*.xml' + } + } + } + + stage ('Tests & Analysis') { + steps { + parallel( + a: { + sh 'mvn test' + + publishHTML target: [ + allowMissing: false, + alwaysLinkToLastBuild: false, + keepAll: true, + reportDir: 'coverage', + reportFiles: 'index.html', + reportName: 'RCov Report' + ] + }, + b: { + sh 'mvn sonar:sonar -Dsonar.projectKey=back-endd -Dsonar.organization=kcelestine-github -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=3c1a0d7728eb2d4de7b4684e8d18293ebd7ef91e' + } + ) + } + } + + stage ('Deploy to Dev') { + steps { + sh 'ls' + } + } + + stage ('Smoke Test') { + steps { + sh 'ls' + } + } + + } // end stages + + post { + always { + archiveArtifacts artifacts: 'target/*.jar', fingerprint: true + junit 'target/surefire-reports/**/*.xml' + archiveArtifacts artifacts: 'target/site/jacoco-both/index.html', fingerprint: true + } + } +} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..6d531cc9 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.java.binaries=./sonar-scanner-3.3.0.1492-linux/jre/lib +sonar.projectKey=back-endd +sonar.organization=kcelestine-github +sonar.sources=. +sonar.host.url=https://sonarcloud.io +sonar.login=3c1a0d7728eb2d4de7b4684e8d18293ebd7ef91e