#!/usr/bin/env bash set -e # Crash when a command fails # https://stackoverflow.com/questions/7334754/correct-way-to-check-java-version-from-bash-script JAVA_VERSION=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1) echo "* Build Step: ProLinuxd *" java -version [ "$JAVA_VERSION" -eq 17 ] && echo "* Java version = 17 ✔️" || (echo "* Building prolinuxd requires JDK 17!" && exit -1) cd prolinuxd-java ./gradlew build cd .. ls -l ./prolinuxd-java/build/distributions/ cp -v ./prolinuxd-java/build/distributions/* ../artifacts/