-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
44 lines (44 loc) · 1.03 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
pipeline {
agent none
options {
copyArtifactPermission('*');
skipDefaultCheckout true
}
environment { plugin = "AdminToolbox" }
triggers {
upstream '/Runsafe/Framework/' + env.BRANCH_NAME
pollSCM '@monthly'
}
stages {
stage('Ant Build') {
agent { label 'ant' }
tools {
ant 'Default'
jdk 'Default'
}
steps {
buildPluginWithAnt env.plugin, '', 'build/jar/*.jar'
cleanWs cleanWhenFailure: false, notFailBuild: true
}
}
stage('Deploy to test server') {
when { not { branch 'master' } }
agent { label 'server4' }
steps {
installPlugin "${env.plugin}.tar"
buildReport env.plugin, 'Deployed to test server'
}
}
stage('Deploy to production') {
when { branch 'master' }
agent { label 'server1' }
steps {
stagePlugin "${env.plugin}.tar"
buildReport env.plugin, 'Staged on production server'
}
}
}
post {
failure { buildReport env.plugin, 'Build failed' }
}
}