-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
76 lines (72 loc) · 3.16 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
67
68
69
70
71
72
73
74
75
76
pipeline {
triggers {
// Schedule the build to run every day at 2:30 AM UTC
cron('30 2 * * *')
}
agent {
label 'riscv'
}
stages {
stage('Installs JDK20') {
tools {
jdk "jdk21"
}
steps {
withCredentials([string(credentialsId: 'GITHUB_CREDENTIALS_PSW', variable: 'GITHUB_CREDENTIALS_PSW')]) {
sh '''echo $GITHUB_CREDENTIALS_PSW | gh auth login --with-token
git submodule init
git submodule update
ls -artl
java --version
cd temurin20-binaries
echo "Removing previous binaries"
rm -f "/home/jenkins/OpenJDK20U-jdk_riscv64_linux_hotspot_*.tar.gz"
releaseName=$(gh release list | sed -n '1p' | sed 's/|/ /' | awk '{print $1}')
echo "Downloading for $releaseName"
gh release download $releaseName --pattern 'OpenJDK20U-jdk_riscv64_linux_hotspot_*.tar.gz' -D /home/jenkins
cd /home/jenkins
mainDirName=`tar -tzf OpenJDK20U-jdk_riscv64_linux_hotspot_*.tar.gz | head -1 | cut -f1 -d"/"`
echo "We found $mainDirName as the main dir in the archive"
rm -fr jdk-20* "$mainDirName" /home/jenkins/jdk20
tar -xvzf /home/jenkins/OpenJDK20U-jdk_riscv64_linux_hotspot_*.tar.gz
rm -f /home/jenkins/OpenJDK20U-jdk_riscv64_linux_hotspot_*.tar.gz
ln -s "/home/jenkins/$mainDirName" /home/jenkins/jdk20
ls -artl "/home/jenkins/$mainDirName"
'''
}
}
}
stage('Installs JDK21') {
tools {
jdk "jdk20"
}
steps {
withCredentials([string(credentialsId: 'GITHUB_CREDENTIALS_PSW', variable: 'GITHUB_CREDENTIALS_PSW')]) {
sh '''echo $GITHUB_CREDENTIALS_PSW | gh auth login --with-token
git submodule init
git submodule update
ls -artl
java --version
cd temurin21-binaries
echo "Removing previous binaries"
rm -f "/home/jenkins/OpenJDK21U-jdk_riscv64_linux_hotspot_*.tar.gz"
releaseName=$(gh release list | sed -n '1p' | sed 's/|/ /' | awk '{print $1}')
echo "Downloading for $releaseName"
gh release download $releaseName --pattern 'OpenJDK21U-jdk_riscv64_linux_hotspot_*.tar.gz' -D /home/jenkins
cd /home/jenkins
mainDirName=`tar -tzf OpenJDK21U-jdk_riscv64_linux_hotspot_*.tar.gz | head -1 | cut -f1 -d"/"`
echo "We found $mainDirName as the main dir in the archive"
rm -fr jdk-21* "$mainDirName" /home/jenkins/jdk21
tar -xvzf /home/jenkins/OpenJDK21U-jdk_riscv64_linux_hotspot_*.tar.gz
rm -f /home/jenkins/OpenJDK21U-jdk_riscv64_linux_hotspot_*.tar.gz
ln -s "/home/jenkins/$mainDirName" /home/jenkins/jdk21
ls -artl "/home/jenkins/$mainDirName"
'''
}
}
}
}
options {
timeout(time: 66, unit: 'MINUTES')
}
}