Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git1 #8

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions dil
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vhbk
mnkjn
42 changes: 42 additions & 0 deletions jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
pipeline {
agent any
parameters {
string(name: 'tomcat_dev', defaultValue: '13.59.98.137', description: 'Staging Server')
string(name: 'tomcat_prod', defaultValue: '18.218.209.248', description: 'Production Server')
}

triggers {
pollSCM('* * * * *') // Polling Source Control
}

stages {
stage('Build') {
steps {
sh 'mvn clean package'
}
post {
success
{
echo 'Now Archiving...'
archiveArtifacts artifacts: '**/target/*.war'
}
}
}
stage ('Deployments'){
parallel{
stage('Deploy to Staging') {
steps {
sh "pwd && ls -la"
sh "sudo scp -i /Repo1/devops.pem ./target/*.war ec2-user@${params.tomcat_dev}:/opt/apache-tomcat-7.0.53/webapps"

}
}
stage ("Deploy to Production"){
steps {
sh "scp -i /Repo1/devo.pem ./target/*.war ec2-user@${params.tomcat_prod}:/root/apache-tomcat-7.0.53/webapps"
}
}
}
}
}
}