Skip to content

Commit

Permalink
ci: use installed packages dependencies to detect duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
kofemann committed Aug 26, 2024
1 parent 7ba5b8f commit 3cdddc0
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,22 +210,21 @@ container:
--destination $CI_REGISTRY_IMAGE:$tag
#
# Get maven non-test dependencies, make unique sort, drop the version and check for duplicates
# check packaged libraries: sort, drop the version and check for non unique dependencies
#
Check for duplicate dependencies:
stage: build
image: dcache/maven-java17-tar-build
extends: .build_cache
image: almalinux:9-minimal
allow_failure: true
needs:
- tar
dependencies:
- tar
script:
- mvn -DskipTests -am -pl packages/tar clean dependency:tree > dependency-tree.txt
- |
grep :jar dependency-tree.txt | \
awk '{print $NF}' | \
awk -F: '!/.*:test$/ {printf("%s:%s:%s\n", $1, $2, $4);}' | \
sort -u | \
cut -d : -f 1,2 | \
uniq -D > duplicate-dependencies.txt
- microdnf install -y tar gzip
- mkdir /dcache
- tar -C /dcache --strip-components=1 -xzf packages/tar/target/dcache-*.tar.gz
- ls -1 /dcache/share/classes/ | sort | sed -e 's/\-[0-9].*$//' | uniq -D > duplicate-dependencies.txt
- if [ -s duplicate-dependencies.txt ]; then cat duplicate-dependencies.txt; exit 1; fi

sign_rpm:
Expand Down

0 comments on commit 3cdddc0

Please sign in to comment.