diff --git a/scripts/runAcceptanceTests.sh b/scripts/runAcceptanceTests.sh new file mode 100755 index 0000000..a1aedb5 --- /dev/null +++ b/scripts/runAcceptanceTests.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +set -o errexit +set -o errtrace +set -o nounset +set -o pipefail + +function bootVersion() { + local minor="${1}" + # FOR LATEST + #BOOT_VERSION="\$( curl https://repo.spring.io/libs-snapshot-local/org/springframework/boot/spring-boot-starter/maven-metadata.xml | sed -ne '//s#\s*<[^>]*>\s*##gp')" + curl --silent https://repo.spring.io/libs-snapshot-local/org/springframework/boot/spring-boot-starter/maven-metadata.xml | grep "${minor}." | tail -1 | sed -ne '//s#\s*<[^>]*>\s*##gp' | xargs +} + +function cloudVersion() { + local minor="${1}" + #BOOT_VERSION="\$( curl https://repo.spring.io/libs-snapshot-local/org/springframework/cloud/spring-cloud-dependencies/maven-metadata.xml | sed -ne '//s#\s*<[^>]*>\s*##gp')" + curl --silent https://repo.spring.io/libs-snapshot-local/org/springframework/cloud/spring-cloud-dependencies/maven-metadata.xml | grep "${minor}." | tail -1 | sed -ne '//s#\s*<[^>]*>\s*##gp' | xargs +} + +CURRENT_BOOT_VERSION="${CURRENT_BOOT_VERSION:-}" +CURRENT_CLOUD_VERSION="${CURRENT_CLOUD_VERSION:-}" +[[ -z "${CURRENT_BOOT_VERSION}" ]] && CURRENT_BOOT_VERSION="$( bootVersion "2.2" )" +[[ -z "${CURRENT_CLOUD_VERSION}" ]] && CURRENT_CLOUD_VERSION="$( cloudVersion "Hoxton" )" + +function build() { + echo "Updating parent boot to [${CURRENT_BOOT_VERSION}]" + ./mvnw versions:update-parent "-DparentVersion=(,${CURRENT_BOOT_VERSION}]" -DgenerateBackupPoms=false -DallowSnapshots=true + echo "Running the build with cloud version [${CURRENT_CLOUD_VERSION}]" + ./mvnw clean install -Dspring-cloud.version="${CURRENT_CLOUD_VERSION}" +} + +cat <