Skip to content

Commit 78742ef

Browse files
committed
Added Jenkinsfile for local native builds.
1 parent 49622a7 commit 78742ef

File tree

3 files changed

+167
-1
lines changed

3 files changed

+167
-1
lines changed

Jenkinsfile

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
pipeline {
2+
agent none
3+
tools {
4+
maven 'Maven 3.9.0'
5+
jdk 'Graal JDK 24'
6+
}
7+
8+
environment {
9+
MAVEN_PROPERTIES_ID = "14bec7ec-e689-43dc-9ed9-22767b144939"
10+
BUILD_PROPERTIES_ID = "39194e51-be8a-4574-af3b-baed7a985ca1"
11+
BUILD_PROPERTIES_FILENAME = "bithatch.build.properties"
12+
}
13+
14+
stages {
15+
stage ('TNFS Java') {
16+
parallel {
17+
/*
18+
* Deploy cross platform libraries
19+
*/
20+
stage ('Cross-platform TNFS Jar Libraries') {
21+
agent {
22+
label 'linux'
23+
}
24+
steps {
25+
configFileProvider([
26+
configFile(
27+
fileId: '${env.BUILD_PROPERTIES_ID}',
28+
replaceTokens: true,
29+
targetLocation: '${env.BUILD_PROPERTIES_FILENAME}',
30+
variable: 'BUILD_PROPERTIES'
31+
)
32+
]) {
33+
withMaven(
34+
globalMavenSettingsConfig: '${env.MAVEN_PROPERTIES_ID}'
35+
) {
36+
sh '''
37+
mvn "-Dbuild.projectProperties=$BUILD_PROPERTIES" \
38+
-U clean deploy
39+
'''
40+
}
41+
}
42+
}
43+
}
44+
45+
/*
46+
* Linux AMD64 Installers and Packages
47+
*/
48+
stage ('Linux 64 bit AMD64 TNFS') {
49+
agent {
50+
label 'linux && x86_64'
51+
}
52+
steps {
53+
54+
script {
55+
env.FULL_VERSION = getFullVersion()
56+
echo "Full Version : ${env.FULLVERSION}"
57+
}
58+
59+
configFileProvider([
60+
configFile(
61+
fileId: '${env.BUILD_PROPERTIES_ID}',
62+
replaceTokens: true,
63+
targetLocation: '${env.BUILD_PROPERTIES_FILENAME}',
64+
variable: 'BUILD_PROPERTIES'
65+
)
66+
]) {
67+
withMaven(
68+
globalMavenSettingsConfig: '${env.MAVEN_PROPERTIES_ID}'
69+
) {
70+
sh '''
71+
mvn "-Dbuild.projectProperties=$BUILD_PROPERTIES" \
72+
-U clean package
73+
'''
74+
}
75+
}
76+
}
77+
}
78+
79+
/*
80+
* Linux AARCH64 Installers and Packages
81+
*/
82+
stage ('Linux 64 bit AARCH64 TNFS') {
83+
agent {
84+
label 'linux && aarch64'
85+
}
86+
steps {
87+
88+
script {
89+
env.FULL_VERSION = getFullVersion()
90+
echo "Full Version : ${env.FULLVERSION}"
91+
}
92+
93+
configFileProvider([
94+
configFile(
95+
fileId: '${env.BUILD_PROPERTIES_ID}',
96+
replaceTokens: true,
97+
targetLocation: '${env.BUILD_PROPERTIES_FILENAME}',
98+
variable: 'BUILD_PROPERTIES'
99+
)
100+
]) {
101+
withMaven(
102+
globalMavenSettingsConfig: '${env.MAVEN_PROPERTIES_ID}'
103+
) {
104+
sh '''
105+
mvn "-Dbuild.projectProperties=$BUILD_PROPERTIES" \
106+
-U clean package
107+
'''
108+
}
109+
}
110+
}
111+
}
112+
113+
/*
114+
* MacOS installers
115+
*/
116+
stage ('MacOS Intel TNFS') {
117+
agent {
118+
label 'macos && x86_64'
119+
}
120+
steps {
121+
122+
script {
123+
env.FULL_VERSION = getFullVersion()
124+
echo "Full Version : ${env.FULLVERSION}"
125+
}
126+
127+
configFileProvider([
128+
configFile(
129+
fileId: '${env.BUILD_PROPERTIES_ID}',
130+
replaceTokens: true,
131+
targetLocation: '${env.BUILD_PROPERTIES_FILENAME}',
132+
variable: 'BUILD_PROPERTIES'
133+
)
134+
]) {
135+
withMaven(
136+
globalMavenSettingsConfig: '${env.MAVEN_PROPERTIES_ID}'
137+
) {
138+
sh 'mvn -U -P native-image clean package'
139+
}
140+
}
141+
142+
}
143+
}
144+
145+
}
146+
}
147+
}
148+
}
149+
150+
String getFullVersion() {
151+
def pom = readMavenPom file: "pom.xml"
152+
pom_version_array = pom.version.split('\\.')
153+
suffix_array = pom_version_array[2].split('-')
154+
return pom_version_array[0] + '.' + pom_version_array[1] + "." + suffix_array[0] + "-${BUILD_NUMBER}"
155+
}

pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,11 @@
218218
</plugins>
219219
<pluginManagement>
220220
<plugins>
221-
221+
<plugin>
222+
<artifactId>maven-deploy-plugin</artifactId>
223+
<version>3.1.4</version>
224+
<groupId>org.apache.maven.plugins</groupId>
225+
</plugin>
222226
<plugin>
223227
<groupId>org.apache.maven.plugins</groupId>
224228
<artifactId>maven-javadoc-plugin</artifactId>

sdk/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@
3636
<url>${scmWebRoot}/${project.artifactId}/</url>
3737
<build>
3838
<plugins>
39+
<plugin>
40+
<artifactId>maven-deploy-plugin</artifactId>
41+
<groupId>org.apache.maven.plugins</groupId>
42+
<configuration>
43+
<skip>true</skip>
44+
</configuration>
45+
</plugin>
3946
<plugin>
4047
<artifactId>maven-assembly-plugin</artifactId>
4148
<version>3.1.1</version>

0 commit comments

Comments
 (0)