ci(aio): fix test

This commit is contained in:
Yuan Gao 2017-06-16 18:21:45 -07:00 committed by Matias Niemelä
parent 86949e0c20
commit 97ace57d39
1 changed files with 14 additions and 6 deletions

View File

@ -41,14 +41,22 @@ timestamp=$(date +%s)
payloadData="$payloadData\"timestamp\": $timestamp, "
# Add change source: application, dependencies, or 'application+dependencies'
allChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
yarnChangedFiles=$(grep yarn.lock <<< $allChangedFiles)
yarnChanged=false
allChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -c "")
allChangedFileNames=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
if [[ ! -z $allChangedFiles ]] && [[ ! -z $yarnChangedFiles ]] && [ "$allChangedFiles" != "$yarnChangedFiles" ]; then
change='application+dependencies'
elif [[ ! -z $yarnChangedFiles ]]; then
if [[ $allChangedFileNames == *"yarn.lock"* ]]; then
yarnChanged=true
fi
echo $yarnChanged
echo $allChangedFileNames
if [[ $allChangedFiles -eq 1 ]] && [[ "$yarnChanged" = true ]]; then
# only yarn.lock changed
change='dependencies'
elif [[ ! -z $allChangedFiles ]]; then
elif [[ $allChangedFiles -gt 1 ]] && [[ "$yarnChanged" = true ]]; then
change='application+dependencies'
elif [[ $allChangedFiles -gt 0 ]]; then
change='application'
else
change=''