-
Notifications
You must be signed in to change notification settings - Fork 105
/
check-versions-for-release.sh
executable file
·31 lines (28 loc) · 1.38 KB
/
check-versions-for-release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
if [ "$1" == "" ]; then
echo "Argument: <release-type> required (one of 'ga|milestone|snapshot')"
exit 1
fi
RELEASE_TYPE="$1"
set +e
if [ "$RELEASE_TYPE" = "milestone" ]; then
echo "Checking versions for $RELEASE_TYPE release"
lines=$(find . -type f -name pom.xml -not -path "./spring-cloud-dataflow-apps-plugin/*" | xargs grep SNAPSHOT | grep -v "SNAPSHOT</spring-cloud-dataflow-apps-" | grep -v ".contains(" | grep -v regex | wc -l)
if [ $lines -ne 0 ]; then
echo "Snapshots version found ($lines):"
echo $(find . -type f -name pom.xml -not -path "./spring-cloud-dataflow-apps-plugin/*" | xargs grep SNAPSHOT | grep -v "SNAPSHOT</spring-cloud-dataflow-apps-" | grep -v ".contains(" | grep -v regex)
echo "Exiting release build"
exit 1
fi
elif [ "$RELEASE_TYPE" = "ga" ]; then
echo "Checking versions for $RELEASE_TYPE release"
lines=$(find . -type f -name pom.xml -not -path "./spring-cloud-dataflow-apps-plugin/*" | xargs egrep "SNAPSHOT|M[0-9]|RC[0-9]" | grep -v ".contains(" | grep -v regex | wc -l)
if [ $lines -ne 0 ]; then
echo "Non release versions found ($lines):"
echo $(find . -type f -name pom.xml -not -path "./spring-cloud-dataflow-apps-plugin/*" | xargs egrep "SNAPSHOT|M[0-9]|RC[0-9]" | grep -v ".contains(" | grep -v regex)
echo "Exiting release build"
exit 1
fi
else
echo "Not checking versions for $RELEASE_TYPE release"
fi