This repository has been archived by the owner on Jul 22, 2020. It is now read-only.
forked from eclipse-zenoh/zenoh-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
65 lines (62 loc) · 2.2 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
pipeline {
agent any
parameters {
gitParameter name: 'TAG',
type: 'PT_TAG',
defaultValue: 'master'
}
stages {
stage('Native libs build (on dedicated agent)') {
agent { label 'UbuntuVM' }
steps {
cleanWs()
checkout([$class: 'GitSCM',
branches: [[name: "${params.TAG}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [],
gitTool: 'Default',
submoduleCfg: [],
userRemoteConfigs: [[url: 'https://github.com/eclipse-zenoh/zenoh-java.git']]
])
sh '''
git log --graph --date=short --pretty=tformat:'%ad - %h - %cn -%d %s' -n 20 || true
cd zenoh
mvn -Prelease generate-sources
'''
stash includes: 'zenoh/target/generated-sources/**/*.java, zenoh/target/resources/**/*zenohc_java.*', name: 'nativeLibs'
}
}
stage('Release build') {
tools {
maven 'apache-maven-latest'
jdk 'adoptopenjdk-hotspot-jdk8-latest'
}
steps {
cleanWs()
checkout([$class: 'GitSCM',
branches: [[name: "${params.TAG}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [],
gitTool: 'Default',
submoduleCfg: [],
userRemoteConfigs: [[url: 'https://github.com/eclipse-zenoh/zenoh-java.git']]
])
unstash 'nativeLibs'
sh '''
ls -al zenoh/target/generated-sources/java/org/eclipse/zenoh/swig/
ls -al zenoh/target/resources/natives/*
'''
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
sh 'gpg --batch --import "${KEYRING}"'
sh 'for fpr in $(gpg --list-keys --with-colons | awk -F: \'/fpr:/ {print $10}\' | sort -u); do echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key ${fpr} trust; done'
}
sh 'mvn -Djipp -Prelease install'
}
}
}
post {
success {
archiveArtifacts artifacts: 'zenoh/target/zenoh-*.jar, examples/*/target/zenoh-*.jar', fingerprint: true
}
}
}