Added acceptance tests script

This commit is contained in:
Marcin Grzejszczak
2019-12-28 12:08:17 +01:00
parent 9c5384264e
commit 2882a84f6e

41
scripts/runAcceptanceTests.sh Executable file
View File

@@ -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 '/<latest>/s#\s*<[^>]*>\s*##gp')"
curl --silent https://repo.spring.io/libs-snapshot-local/org/springframework/boot/spring-boot-starter/maven-metadata.xml | grep "<version>${minor}." | tail -1 | sed -ne '/<version>/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 '/<latest>/s#\s*<[^>]*>\s*##gp')"
curl --silent https://repo.spring.io/libs-snapshot-local/org/springframework/cloud/spring-cloud-dependencies/maven-metadata.xml | grep "<version>${minor}." | tail -1 | sed -ne '/<version>/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 <<EOF
VERSIONS:
CURRENT_BOOT_VERSION="${CURRENT_BOOT_VERSION}"
CURRENT_CLOUD_VERSION="${CURRENT_CLOUD_VERSION}"
EOF
build