Update the build.sh to use a more proper tag sort and avoid allocating a tty
@@ -6,8 +6,8 @@ set -x
HERE=$(dirname $0)
cd $HERE
-# There's no way to get tags ordered by date from GitHub API (in a single query), fall back to using the Git repository
-BLUEOCEAN_VERSION=$(git tag --sort=-taggerdate | egrep '^blueocean-parent' | egrep -o '[0-9]+(\.[0-9]+)+.*' | head -1)
+BLUEOCEAN_VERSION=$(git for-each-ref --sort=-taggerdate refs/tags | tail -n 1 | awk '{print $3 }' | sed 's/refs\/tags\/blueocean-parent-//')
+
# Check if the image already exists
if docker pull jenkinsci/blueocean:$BLUEOCEAN_VERSION; then
@@ -23,7 +23,7 @@ docker pull jenkins:latest
# Note: we don't use "install-plugins.sh" script from the official Jenkins Docker image because we want to use Maven to resolve
# plugin dependency. For BO we will all blueocean-* plugins to be the same version. The aforementioned script downloads latest version
# of dependent plugins, so we would need to list all BO plugins and do it in the right order (if there's any)
-docker run -it --rm -v "$PWD":/usr/src/boplugins -w /usr/src/boplugins maven:3.3.9 -u "$(id -u)" mvn "-Dblueocean.version=$BLUEOCEAN_VERSION" package
+docker run -i --rm -v "$PWD":/usr/src/boplugins -w /usr/src/boplugins maven:3.3.9 -u "$(id -u)" mvn "-Dblueocean.version=$BLUEOCEAN_VERSION" package
# Build the image
docker build --no-cache --pull \
