Skip to content

Commit 6dd0535

Browse files
authored
Create Jenkins1
1 parent 3de25b2 commit 6dd0535

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Jenkins1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
node{
2+
def mavenHome=tool name:"maven3.6.2", type:"maven"
3+
4+
stage('sourcecode'){
5+
git branch: 'development', credentialsId: 'c86056ee-9667-487c-b9a1-7455a6bf518f', url: 'https://github.com/mouniraja/maven-web-application.git'
6+
}
7+
stage('build'){
8+
sh "${mavenHome}/bin/mvn clean package"
9+
}
10+
stage('generateReports')
11+
{
12+
sh "${mavenHome}/bin/mvn sonar:sonar"
13+
}
14+
stage('uploadArtifactoryNexus')
15+
{
16+
sh "${mavenHome}/bin/mvn clean deploy"
17+
}
18+
stage('deployapplication')
19+
{
20+
sshagent(['f28da738-e97b-47c5-965a-6cc5cb834488']) {
21+
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.27/webapps/maven-web-application.war"
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)