forked from jleetutorial/maven-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
49 lines (38 loc) · 1.36 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
pipeline {
agent any
parameters{
string(name: 'tomcat_dev', defaultValue:'18.136.196.251',description:'Staging Server')
string(name: 'tomcat_prod', defaultValue:'54.179.167.252',description:'Production Server')
}
triggers{
pollSCM('* * * * *')
}
stages{
stage('Build'){
steps{
bat 'mvn clean package'
}
post{
success{
echo 'Now archiving...'
archiveArtifacts artifacts: '**/*.war'
}
}
}
stage('Deployments'){
parallel{
stage('Deploy to Staging'){
steps{
bat 'winscp open scp:ec2-user@[email protected]:/var/lib/tomcat7/webapps -privatekey=C:/Users/aussie.haryono/PycharmProjects/TomcatDemo.ppk -hostkey="ssh-ed25519 256 ikuan5siBY4ZB2EDK3zMABwmTOqHA8dDozMnsfPj0O8"'
bat 'winscp put **/*.war'
}
}
stage('Deploy to Prod'){
steps{
bat 'winscp /command "open scp:ec2-user@[email protected]:/var/lib/tomcat7/webapps -privatekey=C:/Users/aussie.haryono/PycharmProjects/TomcatDemo.ppk" "put **/*.war" "exit"'
}
}
}
}
}
}