improve gnu scripts

This commit is contained in:
Eugenio Romano
2019-03-20 00:35:15 +00:00
parent e392d3e602
commit 561dd15b04
3 changed files with 17 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ jobs:
- ./scripts/lint.sh || exit 1
- rm -rf tmp && mkdir tmp
- git merge-base origin/$TRAVIS_BRANCH HEAD > ./tmp/devhead.txt
- (./scripts/smart-build.sh -b $TRAVIS_BRANCH || exit 1;);
- (./scripts/smart-build.sh -b $TRAVIS_BRANCH -gnu || exit 1;);
- npm run build:dist || exit 1
- ./scripts/license-list-generator.sh
- stage: Unit test

View File

@@ -48,6 +48,7 @@ git merge-base origin/$BRANCH_NAME HEAD > ./$DIRECTORY/devhead.txt
fi
HEAD_SHA_BRANCH="$(cat ./$DIRECTORY/devhead.txt)"
echo ""
echo "Branch name $BRANCH_NAME HEAD sha " $HEAD_SHA_BRANCH
# tmp folder doesn't exist.

View File

@@ -1,20 +1,28 @@
#!/usr/bin/env bash
eval BRANCH_NAME=""
eval GNU=false
show_help() {
echo "Usage: smart-build.sh"
echo ""
echo "-b branch name"
echo "-gnu for gnu"
}
branch_name(){
BRANCH_NAME=$1
}
gnu_mode() {
echo "====== GNU MODE ====="
GNU=true
}
while [[ $1 == -* ]]; do
case "$1" in
-b) branch_name $2; shift 2;;
-gnu) gnu_mode; shift;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 0;;
esac
done
@@ -25,8 +33,14 @@ then
exit 0
fi
if $GNU; then
gnu='-gnu'
else
gnu=''
fi
#reset the tmp folder
affected="$(./scripts/affected-libs.sh -gnu -b "$BRANCH_NAME")"
affected="$(./scripts/affected-libs.sh ${gnu[@]} -b "$BRANCH_NAME")"
echo $affected
libs=(`echo $affected | sed 's/^$/\n/g'`)