From cb3cb4ea242fe6e9dbcd7510871b5effce118fa9 Mon Sep 17 00:00:00 2001 From: Falko Modler Date: Fri, 12 Feb 2021 12:50:58 +0100 Subject: [PATCH] Improve update-extension-dependencies.sh --- .github/workflows/ci-actions.yml | 2 +- update-extension-dependencies.sh | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 8759c7dba8586..6613511768909 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -95,7 +95,7 @@ jobs: - name: Verify extension dependencies shell: bash run: | - ./update-extension-dependencies.sh + ./update-extension-dependencies.sh -B --settings .github/mvn-settings.xml if [ `git status -s -u no '*pom.xml' | wc -l` -ne 0 ] then echo -e '\033[0;31mError:\033[0m Dependencies to extension artifacts are outdated! Run ./update-extension-dependencies.sh and add the modified pom.xml files to your commit.' 1>&2 diff --git a/update-extension-dependencies.sh b/update-extension-dependencies.sh index 54e34f570f35e..f5329c61f0d85 100755 --- a/update-extension-dependencies.sh +++ b/update-extension-dependencies.sh @@ -8,7 +8,7 @@ shopt -s failglob echo '' echo 'Building bom-descriptor-json...' echo '' -mvn clean package -f devtools/bom-descriptor-json +mvn -e clean package -f devtools/bom-descriptor-json -Denforcer.skip $* DEP_TEMPLATE=' io.quarkus @@ -28,7 +28,16 @@ echo '' echo 'Building dependencies list from bom-descriptor-json...' echo '' +# get all "artifact-id" values from the generated json file +# pipefail is switched off briefly so that a better error can be logged when nothing is found +set +o pipefail ARTIFACT_IDS=`grep -Po '(?<="artifact-id": ")(?!quarkus-bom)[^"]+' devtools/bom-descriptor-json/target/*.json | sort` +set -o pipefail +if [ -z "${ARTIFACT_IDS}" ] +then + echo -e '\033[0;31mError:\033[0m Could not find any artifact-ids. Please check the grep command. ' 1>&2 + exit 1 +fi # to replace newlines with \n so that the final sed calls accept ${DEPS_*} as input SED_EXPR_NEWLINES=':a;N;$!ba;s/\n/\\\n/g'