Exit1 in case the build fails (#3988)

This commit is contained in:
Maurizio Vitale
2018-11-19 17:23:23 +00:00
committed by Eugenio Romano
parent 2a816d3b47
commit f528d23aff
2 changed files with 33 additions and 8 deletions

View File

@@ -48,7 +48,7 @@ jobs:
- npm install
- ./scripts/lint.sh || exit 1
- npm run spellcheck || exit 1
- rm -rf tmp && (./scripts/smart-build.sh || exit 1;);
- rm -rf tmp && (./scripts/smart-build.sh -b $TRAVIS_BRANCH || exit 1;);
- npm run build:dist || exit 1
- stage: Unit test
name: core

View File

@@ -1,13 +1,38 @@
#!/usr/bin/env bash
affected="$(./scripts/affected-libs.sh -b "$TRAVIS_BRANCH")"
eval BRANCH_NAME=""
show_help() {
echo "Usage: smart-build.sh"
echo ""
echo "-b branch name"
}
branch_name(){
BRANCH_NAME=$1
}
while [[ $1 == -* ]]; do
case "$1" in
-b) branch_name $2; shift 2;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 0;;
esac
done
if [[ "$BRANCH_NAME" == "" ]]
then
echo "The branch name is mandatory"
exit 0
fi
affected="$(./scripts/affected-libs.sh -b "$BRANCH_NAME")"
libs=(`echo $affected | sed 's/^$/\n/g'`)
#core
for i in "${libs[@]}"
do
if [ "$i" == "core$" ] ; then
./scripts/build-core.sh
./scripts/build-core.sh || exit 1;
fi
done
@@ -15,7 +40,7 @@ done
for i in "${libs[@]}"
do
if [ "$i" == "content-services$" ] ; then
./scripts/build-content-services.sh
./scripts/build-content-services.sh || exit 1;
fi
done
@@ -23,7 +48,7 @@ done
for i in "${libs[@]}"
do
if [ "$i" == "process-services$" ] ; then
./scripts/build-process-services.sh
./scripts/build-process-services.sh || exit 1;
fi
done
@@ -31,7 +56,7 @@ done
for i in "${libs[@]}"
do
if [ "$i" == "process-services-cloud$" ] ; then
./scripts/build-process-services-cloud.sh
./scripts/build-process-services-cloud.sh || exit 1;
fi
done
@@ -39,7 +64,7 @@ done
for i in "${libs[@]}"
do
if [ "$i" == "insights$" ] ; then
./scripts/build-insights.sh
./scripts/build-insights.sh || exit 1;
fi
done
@@ -47,6 +72,6 @@ done
for i in "${libs[@]}"
do
if [ "$i" == "extensions$" ] ; then
./scripts/build-extensions.sh
./scripts/build-extensions.sh || exit 1;
fi
done