forked from Raghupatik/java-test
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
41 lines (34 loc) · 863 Bytes
/
Jenkinsfile
File metadata and controls
41 lines (34 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
pipeline {
agent any
environment {
function_name = 'aws-1-pepiline'
}
stages {
stage('Build') {
steps {
// Build the Java project using Maven
sh 'mvn clean package'
}
}
stage("SonarQube analysis") {
agent any
steps {
withSonarQubeEnv('bathiniarun') {
sh 'mvn sonar:sonar'
}
}
}
stage('Push to S3') {
steps {
// Push the built JAR file to an S3 bucket
sh 'aws s3 cp target/sample-1.0.3.jar s3://redbull-f1/'
}
}
stage('Deploy to Lambda') {
steps {
// Deploy the JAR file to AWS Lambda
sh 'aws lambda update-function-code --function-name aws-1-pepiline --region us-east-1 --s3-bucket redbull-f1 --s3-key sample-1.0.3.jar'
}
}
}
}