KEMBAR78
Jenkins CI/CD Pipeline Script | PDF | Teaching Methods & Materials
0% found this document useful (0 votes)
277 views1 page

Jenkins CI/CD Pipeline Script

This Jenkinsfile defines a continuous integration and deployment pipeline with 4 stages: 1) downloading code from GitHub, 2) building the code using Maven, 3) deploying the built code to a QA environment, and 4) running tests on the QA environment. Upon successful completion of all stages, the pipeline prompts for approval before deploying the code to the production environment.

Uploaded by

veeren
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
277 views1 page

Jenkins CI/CD Pipeline Script

This Jenkinsfile defines a continuous integration and deployment pipeline with 4 stages: 1) downloading code from GitHub, 2) building the code using Maven, 3) deploying the built code to a QA environment, and 4) running tests on the QA environment. Upon successful completion of all stages, the pipeline prompts for approval before deploying the code to the production environment.

Uploaded by

veeren
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

pipeline

{
agent any
stages
{

stage('continuos download')
{
steps{
git 'https://github.com/selenium-saikrishna/maven.git'
}
}

stage('continuos build')
{
steps{
sh '''mvn clean
mvn package'''
}
}

stage('continuous deployment')
{
steps{
sh 'scp /var/lib/jenkins/workspace/Pipeline/webapp/target/webapp.war
ubuntu@172.31.24.45:/var/lib/tomcat7/webapps/qaenv.war'
}
}

stage('continuous testing')
{
steps{
git 'https://github.com/selenium-saikrishna/testing.git'
sh 'java -jar /var/lib/jenkins/workspace/Pipeline/testing.jar'
}
}
}
post{
success{

input 'Do you approve deployment?'


sh 'scp /var/lib/jenkins/workspace/Pipeline/webapp/target/webapp.war
ubuntu@172.31.25.93:/var/lib/tomcat7/webapps/prodenv.war'

}
}

You might also like