Skip to content

Commit 705ebc8

Browse files
authored
Create jenkinsfile.declarative
1 parent f79aba8 commit 705ebc8

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

jenkinsfile.declarative

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
pipeline{
2+
agent {label 'java'}
3+
environment{
4+
PATH= "/opt/apache-maven-3.9.9/bin/:$PATH"
5+
}
6+
7+
stages{
8+
stage('checkout'){
9+
steps{
10+
git branch: 'main', url: 'https://github.com/BinduPrivate/java-example.git'
11+
}
12+
}
13+
14+
stage(‘Test’){
15+
steps{
16+
echo ‘running unit and integration test’
17+
}
18+
}
19+
20+
stage('Build'){
21+
steps{
22+
sh 'mvn clean package'
23+
}
24+
}
25+
stage('Deploy'){
26+
steps{
27+
sh 'sudo rsync -av /home/ubuntu/jenkins/workspace/artifact-deployment/target/works-with-heroku-1.0.war /opt/apache-tomcat-9.0.96/webapps'
28+
echo 'deployed successfully'
29+
}
30+
}
31+
32+
}
33+
}

0 commit comments

Comments
 (0)