-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
67 lines (65 loc) · 2.19 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
pipeline {
agent {
node {
label 'carbonio-agent-v1'
}
}
environment {
JAVA_OPTS = '-Dfile.encoding=UTF8'
LC_ALL = 'C.UTF-8'
jenkins_build = 'true'
}
options {
buildDiscarder(logRotator(numToKeepStr: '25'))
timeout(time: 2, unit: 'HOURS')
skipDefaultCheckout()
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build') {
steps {
withCredentials([file(credentialsId: 'artifactory-jenkins-gradle-properties', variable: 'CREDENTIALS')]) {
sh '''
cat <<EOF > build.properties
debug=0
is-production=1
carbonio.buildinfo.version=22.5.0_ZEXTRAS_202205
EOF
'''
sh "cat ${CREDENTIALS} | sed -E 's#\\\\#\\\\\\\\#g' >> build.properties"
sh '''
ANT_RESPECT_JAVA_HOME=true JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ ant \
-propertyfile build.properties \
jar
'''
}
}
}
stage('Publish to maven') {
when {
buildingTag()
}
steps {
withCredentials([file(credentialsId: 'artifactory-jenkins-gradle-properties', variable: 'CREDENTIALS')]) {
sh '''
cat <<EOF > build.properties
debug=0
is-production=1
carbonio.buildinfo.version=22.5.0_ZEXTRAS_202205
EOF
'''
sh "cat ${CREDENTIALS} | sed -E 's#\\\\#\\\\\\\\#g' >> build.properties"
sh '''
ANT_RESPECT_JAVA_HOME=true JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ ant \
-propertyfile build.properties \
publish-maven-all
'''
}
}
}
}
}