-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
40 lines (35 loc) · 1.04 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
pipeline {
agent {
label 'projectweek'
}
environment {
PROJECT_NAME = 'competenties-verplichtaanwezig'
}
stages {
stage('build') {
steps {
sh 'mvn -B package -DskipTests'
}
}
stage('test'){
steps {
sh 'rm -rf /usr/local/tomcat/webapps/ROOT'
sh 'cp -r target/*.war /usr/local/tomcat/webapps/ROOT.war'
sh '/usr/local/tomcat/bin/startup.sh'
sh 'mvn -B clean verify'
}
}
stage('deploy') {
steps {
sshagent(credentials: ['b937ad75-8f46-4abb-b138-380d63028115']) {
sh "scp -P 22345 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null target/*.war [email protected]:/opt/tomcat/teams/${env.PROJECT_NAME}/ROOT.war"
}
}
}
}
post {
always {
junit 'target/surefire-reports/*.xml'
}
}
}