fix conditions in gitlab-test (#7676)

* fix conditions in gitlab-test

* Update gitlab-test.sh
This commit is contained in:
Denis S. Soldatov aka General-Beck 2018-01-23 14:55:02 +03:00 committed by GitHub
parent 1e36fc5d0f
commit 50a58e1ae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,17 +3,15 @@
set -e # fail on any error set -e # fail on any error
set -u # treat unset variables as error set -u # treat unset variables as error
export JS_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep ^js/ | wc -l)"
export JS_OLD_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep ^js-old/ | wc -l)"
export RUST_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^test.sh -e ^windows/ -e ^scripts/ -e ^mac/ -e ^nsis/ | wc -l)"
echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED"
echo "JS_FILES_MODIFIED: $JS_FILES_MODIFIED"
echo "JS_OLD_FILES_MODIFIED: $JS_OLD_FILES_MODIFIED"
if [[ "$CI_COMMIT_REF_NAME" = "beta" || "$CI_COMMIT_REF_NAME" = "stable" ]]; then if [[ "$CI_COMMIT_REF_NAME" = "beta" || "$CI_COMMIT_REF_NAME" = "stable" ]]; then
export GIT_COMPARE=$CI_COMMIT_REF_NAME; export GIT_COMPARE=$CI_COMMIT_REF_NAME;
else else
export GIT_COMPARE=master; export GIT_COMPARE=master;
fi fi
export JS_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep ^js/ | wc -l)"
export JS_OLD_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep ^js-old/ | wc -l)"
export RUST_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^test.sh -e ^windows/ -e ^scripts/ -e ^mac/ -e ^nsis/ | wc -l)"
echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED" echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED"
echo "JS_FILES_MODIFIED: $JS_FILES_MODIFIED" echo "JS_FILES_MODIFIED: $JS_FILES_MODIFIED"
echo "JS_OLD_FILES_MODIFIED: $JS_OLD_FILES_MODIFIED" echo "JS_OLD_FILES_MODIFIED: $JS_OLD_FILES_MODIFIED"