diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 35274ca..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,52 +0,0 @@ -pipeline { - agent any - - tools { - // Define tool name and version - maven 'Maven3' - jdk 'JDK8' - } - - stages { - stage('Checkout') { - steps { - // Checkout the code from the SCM - checkout scm - } - } - - stage('Build') { - steps { - // Build the code using Maven - sh 'mvn clean install -DskipTests' - } - } - - stage('Archive') { - steps { - // Archive the build artifacts - arctifacts: '**/target/*.jar', allowEmptyArchive: true - } - } - - stage('Test') { - steps { - // Run the unit tests - sh 'mvn test' - } - } - } - - post { - always { - // Cleanup after the build - deleteDir() - } - success { - echo 'Build was successful!' - } - failure { - echo 'Blded!' - } - } -} diff --git a/README.md b/README.md index 40afaa4..b350152 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +Sample # S4-projects ![del](https://user-images.githubusercontent.com/96950933/216551396-58ffa498-0148-4a61-97ac-74aaeb0bd115.png) diff --git a/weather-app/Jenkinsfile b/weather-app/Jenkinsfile new file mode 100644 index 0000000..9934e10 --- /dev/null +++ b/weather-app/Jenkinsfile @@ -0,0 +1,25 @@ +pipeline { + agent any + + stages { + stage('Checkout SCM') { + steps { + // Your checkout steps here + } + } + stage('SonarQube analysis') { + steps { + script { + def scannerHome = tool name: 'SonarQube Scanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' + // Use the scannerHome in the subsequent steps + withSonarQubeEnv('http://localhost:9000/') { + sh "${scannerHome}/bin/sonar-scanner" + } + } + } + } + // Add more stages as needed + } + + // Post-build actions and other pipeline settings +} diff --git a/weather-app/sonar-project.properties b/weather-app/sonar-project.properties new file mode 100644 index 0000000..4b096f4 --- /dev/null +++ b/weather-app/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.host.url=https://sonarqube.ektechsoftwaresolution.com/ +sonar.projectKey=s4stephane-weatherapp +sonar.projectName=4stephane-weatherapp +sonar.projectVersion=1.0.0 +sonar.sources=. +qualitygate.wait=true \ No newline at end of file