Skip to content

Commit

Permalink
Added builder script for code-tools/jcstress
Browse files Browse the repository at this point in the history
  • Loading branch information
judovana committed Aug 8, 2023
1 parent 187d92c commit 7d08e03
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/code-tools/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ pipeline {
build('asmtools')
}
}
stage('jcstress') {
agent {
label NODE_LABEL
}
steps {
build('jcstress')
}
}
stage('jtreg') {
agent {
label NODE_LABEL
Expand Down
57 changes: 57 additions & 0 deletions tools/code-tools/jcstress.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash
# shellcheck disable=SC2035,SC2155
set -euo pipefail
WORKSPACE=$PWD

function hashArtifacts() {
echo "Creating checksums all asmtools*.jar"
for file in `ls asmtools*.jar asmtools*-tests.tar.gz` ; do
sha256sum $file > $file.sha256sum.txt
done
}

function detectJdks() {
jvm_dir="/usr/lib/jvm/"
find ${jvm_dir} -maxdepth 1 | sort
echo "Available jdks 11 in ${jvm_dir}:"
find ${jvm_dir} -maxdepth 1 | sort | grep -e java-11- -e jdk-11
jdk11=$(readlink -f $(find ${jvm_dir} -maxdepth 1 | sort | grep -e java-11- -e jdk-11 | head -n 1))
}

REPO_DIR="jcstress"
main_name=$REPO_DIR
main_file=$main_name.jar
if [ ! -e $REPO_DIR ] ; then
git clone https://github.com/openjdk/$REPO_DIR.git
else
rm -vf $REPO_DIR/$main_name*.jar
fi
detectJdks
pushd $REPO_DIR
git checkout master
tip=`git log | head -n 1 | sed "s/.*\s\+//"` || true
tip_shortened=`echo ${tip:0:10}`
latestRelease=`git tag -l | sort -Vr | head -n 1`
rc=$main_name-$latestRelease.jar

# latest released
git checkout $latestRelease
export JAVA_HOME=$jdk11
mvn clean install
mv tests-all/target/jcstress.jar $rc
echo "Manually renaming $rc as $main_file to provide latest-stable-recommended file"
ln -sfv $rc $main_file
mvn clean

# tip
git checkout master
export JAVA_HOME=$jdk11
mvn clean install
mv tests-all/target/$main_file $main_name-$tip_shortened.jar
echo "Manually renaming $main_name-$tip_shortened.jar as $main_name-tip.jar to provide latest-unstable-recommended file"
ln -sfv $main_name-$tip_shortened.jar $main_name-tip.jar
mvn clean

echo "Resetting repo back to master"
git checkout master
popd

0 comments on commit 7d08e03

Please sign in to comment.