0% found this document useful (0 votes)
203 views

Groovy 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)
203 views

Groovy 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
[email protected]:/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
[email protected]:/var/lib/tomcat7/webapps/prodenv.war'

}
}

You might also like