release.sh 913 Bytes
Newer Older
Benoit Lavenier's avatar
Benoit Lavenier committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/bash

echo "**********************************"
echo "* Preparing release..."
echo "**********************************"
result=`mvn release:clean`
failure=`echo "$result" | grep -m1 -P "\[INFO\] BUILD FAILURE"  | grep -oP "BUILD \w+"`
# prepare failed
if [[ ! "_$failure" = "_" ]]; then
    echo "$result" | grep -P "\[ERROR\] "
    exit 1
fi

Benoit Lavenier's avatar
Benoit Lavenier committed
14
mvn release:prepare -Darguments="-DskipTests -DperformFullRelease"
15
if [[ $? -ne 0 ]]; then
Benoit Lavenier's avatar
Benoit Lavenier committed
16 17 18 19 20 21
    exit 1
fi

echo "**********************************"
echo "* Performing release..."
echo "**********************************"
Benoit Lavenier's avatar
Benoit Lavenier committed
22
mvn release:perform --quiet -Darguments="-DskipTests -DperformFullRelease"
23
if [[ $? -ne 0 ]]; then
Benoit Lavenier's avatar
Benoit Lavenier committed
24 25 26 27 28 29
    exit 1
fi

echo "**********************************"
echo "* Uploading artifacts to Github..."
echo "**********************************"
Benoit Lavenier's avatar
Benoit Lavenier committed
30
cd target/checkout
Benoit Lavenier's avatar
Benoit Lavenier committed
31
./github.sh pre
32
if [[ $? -ne 0 ]]; then
Benoit Lavenier's avatar
Benoit Lavenier committed
33 34 35 36 37
    exit 1
fi

echo "RELEASE finished !"