Skip to content

Commit

Permalink
Improve update-extension-dependencies.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
famod committed Feb 12, 2021
1 parent 81b9cd2 commit cb3cb4e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion update-extension-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=' <dependency>
<groupId>io.quarkus</groupId>
Expand All @@ -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'
Expand Down

0 comments on commit cb3cb4e

Please sign in to comment.