-
Notifications
You must be signed in to change notification settings - Fork 148
/
dependencies-report
executable file
·54 lines (47 loc) · 1.26 KB
/
dependencies-report
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
set -e
set -x
SRCPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
outfile=dependencies.csv
while :; do
case $1 in
--csv)
if [ "$2" ]; then
outfile=$2
else
echo "ERROR: --csv needs a non-empty argument"
exit 1
fi
shift
;;
--csv=?*)
outfile=${1#*=}
;;
--csv=)
echo "ERROR: --csv needs a non-empty argument"
exit 1
;;
*)
break
;;
esac
shift
done
go mod tidy
go mod download
go list -m -json all $@ | go run go.elastic.co/go-licence-detector \
-includeIndirect \
-rules "$SRCPATH/notice/rules.json" \
-overrides "$SRCPATH/notice/overrides.json" \
-noticeTemplate "$SRCPATH/notice/dependencies.csv.tmpl" \
-noticeOut "$outfile" \
-depsOut ""
# Fill-in required values for UBI images
# Check headers in $SRCPATH/notice/dependencies.csv.tmpl:
# name,url,version,revision,license
ubiurl='https://catalog.redhat.com/software/containers/ubi9/ubi-minimal/615bd9b4075b022acc111bf5'
ubisource='https://oss-dependencies.elastic.co/red-hat-universal-base-image-minimal/9/ubi-minimal-9-source.tar.gz'
ubilicense='Custom;https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf'
cat <<EOF >> $outfile
Red Hat Universal Base Image minimal,$ubiurl,9,,$ubilicense,$ubisource
EOF