diff --git a/Jenkinsfile b/Jenkinsfile index b992b7c..e416933 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any environment { - function_name = 'java-sample' + function_name = 'jenkins-007' } stages { @@ -13,20 +13,35 @@ pipeline { } } - stage('Push') { + stages { + stage("SonarQube analysis") { + agent any steps { - echo 'Push' - - sh "aws s3 cp target/sample-1.0.3.jar s3://bermtecbatch31" + withSonarQubeEnv('mysonar') { + sh 'mvn sonar:sonar' + } } + } + } + } + } - stage('Deploy') { - steps { - echo 'Build' - sh "aws lambda update-function-code --function-name $function_name --region us-east-1 --s3-bucket bermtecbatch31 --s3-key sample-1.0.3.jar" - } - } - } -} + // stage('Push') { + // steps { + // echo 'Push' + + // sh "aws s3 cp target/sample-1.0.3.jar s3://jenkins-007" + // } + // } + +// stage('Deploy') { +// steps { +// echo 'deploy' + +// sh "aws lambda update-function-code --function-name $function_name --region us-east-1 --s3-bucket jenkins-007 --s3-key sample-1.0.3.jar" +// } +// } +// } + diff --git a/pom.xml b/pom.xml index 8f15865..82a1b64 100644 --- a/pom.xml +++ b/pom.xml @@ -3,9 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.example - sample + mysonar 1.0.3 - sample + mysonar jar sample 2022 with Spring Boot @@ -18,6 +18,7 @@ 1.8 1.8 1.8 + chalasani196