Browse Source

fix: add missing concordia prefix to package name directory, account for manual executions in commit range string build

develop
Apostolos Fanakis 4 years ago
parent
commit
e747a15f2e
  1. 18
      jenkins/check_package_changed.sh

18
jenkins/check_package_changed.sh

@ -9,11 +9,23 @@ GIT_COMMIT=$2
GIT_PREVIOUS_COMMIT=$3 GIT_PREVIOUS_COMMIT=$3
ROOT_FILES_AND_FOLDERS=${4:-"package.json" "yarn.lock" ".dockerignore" "docker" "jenkins"} ROOT_FILES_AND_FOLDERS=${4:-"package.json" "yarn.lock" ".dockerignore" "docker" "jenkins"}
function join_by { local IFS="$1"; shift; echo "$*"; } function join_by() {
local IFS="$1"
shift
echo "$*"
}
function package_changed { git diff --name-only "$COMMIT_RANGE" | grep -qE "^packages/$1/" && echo true || echo false; } function package_changed() {
git diff --name-only "$COMMIT_RANGE" | grep -qE "^packages/concordia-$1/" && echo true || echo false
}
if [ "$GIT_COMMIT" == "$GIT_PREVIOUS_COMMIT" ]; then
# Probably a manual re-run, set the range to just the last commit
COMMIT_RANGE="$GIT_COMMIT"
else
COMMIT_RANGE="$GIT_PREVIOUS_COMMIT...$GIT_COMMIT"
fi
COMMIT_RANGE="$GIT_PREVIOUS_COMMIT...$GIT_COMMIT"
ROOT_FILES_AND_FOLDERS_ARRAY=($ROOT_FILES_AND_FOLDERS) ROOT_FILES_AND_FOLDERS_ARRAY=($ROOT_FILES_AND_FOLDERS)
ROOT_FILES_AND_FOLDERS_JOINED=$(join_by "|" ${ROOT_FILES_AND_FOLDERS_ARRAY[*]}) ROOT_FILES_AND_FOLDERS_JOINED=$(join_by "|" ${ROOT_FILES_AND_FOLDERS_ARRAY[*]})

Loading…
Cancel
Save