-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
33 lines (31 loc) · 1.26 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
#!groovy
timestamps {
node {
try {
checkout scm
// Run bash with -it to keep the container alive while we copy files in and run the build
docker.image('frekele/ant:1.9.7-jdk8').withRun('-it -v /var/lib/m2:/root/.m2', 'bash') {c ->
sh """
docker cp ./ ${c.id}:/root
docker exec ${c.id} ant -f /root/source/build.xml dist
mkdir -p dist
docker cp ${c.id}:/root/jars dist
docker exec ${c.id} mkdir -p /root/.m2/repository/cc/clayman/logging/restconsole/0.1.0/
docker cp ./libs/controller/restconsole-0.1.0.jar ${c.id}:/root/.m2/repository/cc/clayman/logging/restconsole/0.1.0/restconsole-0.1.0.jar
docker exec ${c.id} mkdir -p /root/.m2/repository/cc/clayman/logging/Logger/0.1.0/
docker cp ./libs/misc/Logger-0.1.0.jar ${c.id}:/root/.m2/repository/cc/clayman/logging/Logger/0.1.0/Logger-0.1.0.jar
"""
}
echo "Archiving jars..."
archive 'dist/jars/*.jar'
echo "Archiving confs..."
archive 'conf/*'
currentBuild.result = 'SUCCESS'
} catch (any) {
currentBuild.result = 'FAILURE'
throw any
} finally {
step([$class: 'Mailer', recipients: '[email protected]'])
}
}
}