From 95480df358695af62a6ef7444db74066bf010c8f Mon Sep 17 00:00:00 2001 From: Bram Ceulemans Date: Sat, 11 Dec 2021 11:23:38 +0100 Subject: [PATCH] Remove old Airplane versions --- scripts/start-deployAirplane | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/start-deployAirplane b/scripts/start-deployAirplane index 1fde1263c87..45e06228373 100755 --- a/scripts/start-deployAirplane +++ b/scripts/start-deployAirplane @@ -1,10 +1,11 @@ #!/bin/bash -set -euo pipefail -IFS=$'\n\t' . ${SCRIPTS:-/}start-utils +set -euo pipefail isDebugging && set -x +IFS=$'\n\t' + if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.16" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ] && [ "${VERSION}" != "PURPUR-1.16" ] ; then log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.17, VERSION=1.16, VERSION=PURPUR or VERSION=PURPUR-1.16. Note that these are branches, not #.#.# versions." exit 1 @@ -35,6 +36,12 @@ log "Using Airplane-${AIRPLANE_BRANCH} branch" export SERVER=airplane-${AIRPLANE_BRANCH}-${AIRPLANE_BUILD}.jar +log "Removing old Airplane versions ..." +shopt -s nullglob +for f in airplane-*.jar; do + [[ $f != $SERVER ]] && rm $f +done + if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then downloadUrl="https://ci.tivy.ca/job/Airplane-${AIRPLANE_BRANCH}/${AIRPLANE_BUILD}/artifact/launcher-${AIRPLANE_TYPE}.jar" log "Downloading Airplane from $downloadUrl ..."