Running tests for parsed version
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
source common.sh || source scripts/common.sh || echo "No common.sh script found..."
|
||||
|
||||
ROOT_FOLDER=`pwd`
|
||||
echo "Current folder is $ROOT_FOLDER"
|
||||
|
||||
if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
|
||||
cd ..
|
||||
ROOT_FOLDER=`pwd`
|
||||
fi
|
||||
set -e
|
||||
|
||||
ADDITIONAL_MAVEN_OPTS=${ADDITIONAL_MAVEN_OPTS:--Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn}
|
||||
|
||||
echo "Building Maven and Gradle projects for version [$VERIFIER_VERSION]"
|
||||
|
||||
echo "Building Maven stuff with additional opts [$ADDITIONAL_MAVEN_OPTS]"
|
||||
./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Psonar --batch-mode $ADDITIONAL_MAVEN_OPTS
|
||||
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
source common.sh || source scripts/common.sh || echo "No common.sh script found..."
|
||||
|
||||
ROOT_FOLDER=`pwd`
|
||||
echo "Current folder is $ROOT_FOLDER"
|
||||
|
||||
if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
|
||||
cd ..
|
||||
ROOT_FOLDER=`pwd`
|
||||
fi
|
||||
set -e
|
||||
|
||||
function print_usage() {
|
||||
cat <<EOF
|
||||
@@ -39,7 +33,13 @@ esac
|
||||
shift # past argument or value
|
||||
done
|
||||
|
||||
[[ -z "${VERIFIER_VERSION}" ]] && VERIFIER_VERSION="1.0.0.BUILD-SNAPSHOT"
|
||||
# Code grepping for the 3rd presence of "version" in pom.xml.
|
||||
# The 3rd one is where we define the SC-Contract version
|
||||
VERSION_NODE=`awk '/version/{i++}i==3{print; exit}' $ROOT_FOLDER/pom.xml`
|
||||
# Extract the contents of the version node
|
||||
VERSION_VALUE=$(sed -ne '/version/{s/.*<version>\(.*\)<\/version>.*/\1/p;q;}' <<< "$VERSION_NODE")
|
||||
|
||||
[[ -z "${VERIFIER_VERSION}" ]] && VERIFIER_VERSION="$VERSION_VALUE"
|
||||
export VERIFIER_VERSION
|
||||
|
||||
echo -e "\n\nBUILDING AND RUNNING TESTS FOR VERIFIER IN VERSION [$VERIFIER_VERSION]\n\n"
|
||||
|
||||
24
scripts/common.sh
Executable file
24
scripts/common.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
ROOT_FOLDER=`pwd`
|
||||
echo "Current folder is $ROOT_FOLDER"
|
||||
|
||||
if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
|
||||
cd ..
|
||||
ROOT_FOLDER=`pwd`
|
||||
fi
|
||||
|
||||
echo "Root folder is $ROOT_FOLDER"
|
||||
|
||||
# Code grepping for the 3rd presence of "version" in pom.xml.
|
||||
# The 3rd one is where we define the SC-Contract version
|
||||
VERSION_NODE=`awk '/version/{i++}i==3{print; exit}' $ROOT_FOLDER/pom.xml`
|
||||
# Extract the contents of the version node
|
||||
VERSION_VALUE=$(sed -ne '/version/{s/.*<version>\(.*\)<\/version>.*/\1/p;q;}' <<< "$VERSION_NODE")
|
||||
|
||||
echo "Extracted version from root pom.xml is [$VERSION_VALUE]"
|
||||
|
||||
export ROOT_FOLDER
|
||||
export VERSION_VALUE
|
||||
@@ -1,14 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
|
||||
ROOT_FOLDER=`pwd`
|
||||
echo "Current folder is $ROOT_FOLDER"
|
||||
|
||||
if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
|
||||
cd ..
|
||||
ROOT_FOLDER=`pwd`
|
||||
fi
|
||||
source common.sh || source scripts/common.sh || echo "No common.sh script found..."
|
||||
|
||||
set -e
|
||||
|
||||
./mvnw clean install && (cd *-gradle-plugin; ./gradlew clean build install) && ./scripts/runTests.sh && ./mvnw deploy && (cd *-gradle-plugin; ./gradlew uploadArchives -x test)
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
source common.sh || source scripts/common.sh || echo "No common.sh script found..."
|
||||
|
||||
ROOT_FOLDER=`pwd`
|
||||
echo "Current folder is $ROOT_FOLDER"
|
||||
|
||||
if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
|
||||
cd ..
|
||||
ROOT_FOLDER=`pwd`
|
||||
fi
|
||||
set -e
|
||||
|
||||
./mvnw -s .settings.xml --fail-never dependency:go-offline || true
|
||||
cd $ROOT_FOLDER/spring-cloud-contact-gradle-plugin && ./gradlew resolveDependencies || true
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
source common.sh || source scripts/common.sh || echo "No common.sh script found..."
|
||||
|
||||
ROOT_FOLDER=`pwd`
|
||||
echo "Current folder is $ROOT_FOLDER"
|
||||
set -e
|
||||
|
||||
if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
|
||||
cd ..
|
||||
ROOT_FOLDER=`pwd`
|
||||
fi
|
||||
echo "Generating docs for Spring Cloud Contract version [$VERIFIER_VERSION]"
|
||||
|
||||
echo "Building main docs"
|
||||
./mvnw clean install -P docs -DskipTests=true --pl docs
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
source common.sh || source scripts/common.sh || echo "No common.sh script found..."
|
||||
|
||||
ROOT_FOLDER=`pwd`
|
||||
echo "Current folder is $ROOT_FOLDER"
|
||||
set -e
|
||||
|
||||
if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
|
||||
cd ..
|
||||
ROOT_FOLDER=`pwd`
|
||||
fi
|
||||
[[ -z "${VERSION_VALUE}" ]] && VERSION_VALUE="1.0.0.BUILD-SNAPSHOT"
|
||||
[[ -z "${VERIFIER_VERSION}" ]] && VERIFIER_VERSION="$VERSION_VALUE"
|
||||
export VERIFIER_VERSION
|
||||
|
||||
export CONTRACT_VERIFIER_VERSION=${CONTRACT_VERIFIER_VERSION:-1.0.0.BUILD-SNAPSHOT}
|
||||
|
||||
echo "Current Spring Cloud Contract Verifier version is ${CONTRACT_VERIFIER_VERSION}"
|
||||
echo -e "\n\nRUNNING TESTS FOR VERIFIER IN VERSION [${VERIFIER_VERSION}]\n\n"
|
||||
|
||||
cd samples/standalone
|
||||
|
||||
echo "Running Gradle tests"
|
||||
. ./runTests.sh
|
||||
./runTests.sh
|
||||
|
||||
echo "Running Maven tests"
|
||||
. ./runMavenTests.sh
|
||||
./runMavenTests.sh
|
||||
|
||||
cd $ROOT_FOLDER
|
||||
|
||||
Reference in New Issue
Block a user