2018-07-20 10:45:14 +00:00
|
|
|
#!/bin/bash
|
2018-10-09 02:25:28 +00:00
|
|
|
#
|
|
|
|
# A bash script to run CircleCI node/test in parallel
|
|
|
|
#
|
2018-07-20 10:45:14 +00:00
|
|
|
|
|
|
|
NODE_INDEX=${CIRCLE_NODE_INDEX:-0}
|
|
|
|
|
2019-02-24 03:19:09 +00:00
|
|
|
set -e
|
|
|
|
|
2018-07-20 10:45:14 +00:00
|
|
|
if [ "$NODE_INDEX" = "1" ]; then
|
2018-10-09 02:25:28 +00:00
|
|
|
echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..."
|
|
|
|
#cp CI/pom.xml.circleci pom.xml
|
2018-07-20 10:45:14 +00:00
|
|
|
java -version
|
2018-10-09 02:25:28 +00:00
|
|
|
mvn --quiet verify -Psamples.circleci
|
2018-08-31 07:16:41 +00:00
|
|
|
elif [ "$NODE_INDEX" = "2" ]; then
|
2019-03-03 16:06:30 +00:00
|
|
|
# run ensure-up-to-date sample script on SNAPSHOT version only
|
|
|
|
project_version=`mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout`
|
|
|
|
if [[ $project_version == *"-SNAPSHOT" ]]; then
|
|
|
|
echo "Running node $NODE_INDEX to test ensure-up-to-date"
|
|
|
|
java -version
|
|
|
|
./bin/utils/ensure-up-to-date
|
|
|
|
fi
|
2019-02-24 03:19:09 +00:00
|
|
|
elif [ "$NODE_INDEX" = "3" ]; then
|
|
|
|
echo "Running node $NODE_INDEX to test haskell"
|
|
|
|
# install haskell
|
|
|
|
url -sSL https://get.haskellstack.org/ | sh
|
|
|
|
stack upgrade
|
|
|
|
stack --version:w
|
|
|
|
mvn --quiet verify -Psamples.misc
|
2018-07-20 10:45:14 +00:00
|
|
|
else
|
2018-10-09 02:25:28 +00:00
|
|
|
echo "Running node $NODE_INDEX to test 'samples.circleci.jdk7' defined in pom.xml ..."
|
2018-07-20 10:45:14 +00:00
|
|
|
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
|
|
|
|
java -version
|
2018-10-09 02:25:28 +00:00
|
|
|
#cp CI/pom.xml.circleci.java7 pom.xml
|
|
|
|
mvn --quiet verify -Psamples.circleci.jdk7
|
2018-07-20 10:45:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|