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

Feature/mysonar #5

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
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
41 changes: 28 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pipeline {
agent any

environment {
function_name = 'java-sample'
function_name = 'jenkins-007'
}

stages {
Expand All @@ -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"
// }
// }
// }

5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>sample</artifactId>
<artifactId>mysonar</artifactId>
<version>1.0.3</version>
<name>sample</name>
<name>mysonar</name>
<packaging>jar</packaging>
<description>sample 2022 with Spring Boot</description>
<parent>
Expand All @@ -18,6 +18,7 @@
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<sonar.organization>chalasani196</sonar.organization>
</properties>
<dependencies>
<dependency>
Expand Down