diff --git a/Jenkins b/Jenkins new file mode 100644 index 00000000..320b75aa --- /dev/null +++ b/Jenkins @@ -0,0 +1,26 @@ +pipeline{ + agent any + stages{ + stage("Git Checkout"){ + steps{ + git credentialsId: 'github', url: 'https://github.com/machakiran/SaiJavaCode.git' + } + } + stage("Maven Build"){ + steps{ + sh "/opt/apache-maven-3.8.3/bin/mvn package" + } + } + stage("deploy-dev"){ + steps{ + sshagent(['18.206.249.222']) { + sh """ + scp -o StrictHostKeyChecking=no /var/lib/jenkins/workspace/jenkins3/webapp/target/webapp.war ubuntu@18.206.249.222:/opt/apache-tomcat-8.5.72/webapps + ssh ubuntu@18.206.249.222/opt/apache-tomcat-8.5.72/bin/shutdown.sh + ssh ubuntu@18.206.249.222/opt/apache-tomcat-8.5.72/bin/startup.sh + """ + } + } + } + } + } diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..3553f199 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,26 @@ +pipeline{ + agent any + stages{ + stage("Git Checkout"){ + steps{ + git credentialsId: 'github', url: 'https://github.com/machakiran/SaiJavaCode.git' + } + } + stage("Maven Build"){ + steps{ + sh "/opt/apache-maven-3.8.3/bin/mvn package" + } + } + stage("deploy-dev"){ + steps{ + sshagent(['18.206.249.222']) { + sh """ + scp -o StrictHostKeyChecking=no /var/lib/jenkins/workspace/jenkins3/webapp/target/webapp.war ubuntu@18.206.249.222:/opt/apache-tomcat-8.5.72/webapps + ssh ubuntu@18.206.249.222 /opt/apache-tomcat-8.5.72/bin/shutdown.sh + ssh ubuntu@18.206.249.222 /opt/apache-tomcat-8.5.72/bin/startup.sh + """ + } + } + } + } + } diff --git a/webapp/src/main/webapp/index.jsp b/webapp/src/main/webapp/index.jsp index bc70c891..9786adc8 100644 --- a/webapp/src/main/webapp/index.jsp +++ b/webapp/src/main/webapp/index.jsp @@ -1,4 +1,4 @@

Hello Dear Students !!, Welcome to DevOps Project-2 !!

-

By Mr.Hari from Saidemy

-

It's time to start the DevOps Project-2 by Mr.Hari!!

+

By Mr.sree from Saidemy

+

It's time to start the DevOps Project-2 by Mr.sree!!

This is what complete End-to-End CI-CD pipeline Devops project!!