From ef8dacf1b31345a3edfe6458f56245d96d6e1d6a Mon Sep 17 00:00:00 2001 From: Aric Gardner Date: Mon, 27 Jan 2020 14:49:59 -0500 Subject: [PATCH] Fix release file detection commits with multiple parents were not being detected. break long shell command across two lines ISSUE-ID: RELENG-2685 Signed-off-by: Aric Gardner Change-Id: I660fabfba0497ab4c6825853c0fa117bacc93581 Signed-off-by: Lott, Christopher (cl778h) --- releasenotes/notes/lf-release-jobs-911087ad53477868.yaml | 4 ++++ shell/release-job.sh | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/lf-release-jobs-911087ad53477868.yaml diff --git a/releasenotes/notes/lf-release-jobs-911087ad53477868.yaml b/releasenotes/notes/lf-release-jobs-911087ad53477868.yaml new file mode 100644 index 00000000..6e078893 --- /dev/null +++ b/releasenotes/notes/lf-release-jobs-911087ad53477868.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fix release file detection on commit with multiple parents diff --git a/shell/release-job.sh b/shell/release-job.sh index ee5ab70a..afc19fc5 100644 --- a/shell/release-job.sh +++ b/shell/release-job.sh @@ -29,10 +29,12 @@ set_variables_common(){ NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/" # Verify if using release file or parameters if $USE_RELEASE_FILE ; then - release_files=$(git diff-tree -m --no-commit-id -r "$GIT_COMMIT" --name-only -- "releases/" ".releases/") + release_files=$(git diff-tree -m --no-commit-id -r "$GIT_COMMIT" "$GIT_COMMIT^1" \ + --name-only -- "releases/" ".releases/") if (( $(grep -c . <<<"$release_files") > 1 )); then echo "INFO: RELEASE FILES ARE AS FOLLOWS: $release_files" - echo "ERROR: Committing multiple release files in the same commit OR rename/amend of existing files is not supported." + echo "ERROR: Adding multiple release files in the same commit" + echo "ERROR: OR rename/amend/delete of existing files is not supported." exit 1 else release_file="$release_files" -- 2.16.6