Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions licenses/install
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
#!/bin/sh
set -e

# Default mono-install to false
FULL_INSTALL=false

# Parse command line arguments
while [ "$#" -gt 0 ]; do
case "$1" in
--full-install)
FULL_INSTALL=true
shift
;;
*)
echo "Unknown parameter: $1"
exit 1
;;
esac
done

{
echo
echo "Installing license checker engine ..."
echo
} 2>/dev/null

if [ ! -d .bin ]; then
mkdir .bin
fi

curl https://raw.githubusercontent.com/ory/ci/master/licenses/license-engine.sh -o .bin/license-engine.sh
chmod +x .bin/license-engine.sh
curl https://raw.githubusercontent.com/ory/ci/master/licenses/licenses -o .bin/licenses
chmod +x .bin/licenses
curl https://raw.githubusercontent.com/ory/ci/master/licenses/list-licenses -o .bin/list-licenses
chmod +x .bin/list-licenses

if [ -f go.mod ]; then
if [ "$FULL_INSTALL" = true ] || [ -f go.mod ]; then
{
echo
echo "Installing the Go license checker ..."
Expand All @@ -26,7 +45,7 @@ if [ -f go.mod ]; then
curl https://raw.githubusercontent.com/ory/ci/master/licenses/license-template-go.tpl -o .bin/license-template-go.tpl
fi

if [ -f package.json ]; then
if [ "$FULL_INSTALL" = true ] || [ -f package.json ]; then
{
echo
echo "Installing the Node license checker ..."
Expand Down
8 changes: 7 additions & 1 deletion licenses/license-engine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ALLOWED_LICENSES=(
'BSD-3-Clause'
'(BSD-3-Clause OR GPL-2.0)'
'BSD-3-Clause OR MIT'
'(BSD-3-Clause AND Apache-2.0)'
'CC0-1.0'
'CC-BY-3.0'
'CC-BY-4.0'
Expand Down Expand Up @@ -73,7 +74,12 @@ APPROVED_MODULES=(
'github.com/jmespath/go-jmespath' # Apache-2.0 https://github.com/jmespath/go-jmespath/blob/master/LICENSE
'github.com/ory/keto/proto/ory/keto/opl/v1alpha1' # Apache-2.0 - submodule of keto
'github.com/ory/keto/proto/ory/keto/relation_tuples/v1alpha2' # Apache-2.0 - submodule of keto
"golden-fleece@1.0.9" # MIT: https://github.com/Rich-Harris/golden-fleece/blob/master/LICENSE
'@ory-corp/.*' # Ory IP
'github.com/apache/arrow/.*' # Apache-2.0 https://github.com/apache/arrow/blob/main/LICENSE.txt
'github.com/ory-corp/webhook-target' # Ory IP
'@ory/keto-grpc-client.*' # Apache-2.0 - submodule of keto
'golden-fleece@1.0.9' # MIT: https://github.com/Rich-Harris/golden-fleece/blob/master/LICENSE
'github.com/gogo/googleapis/.*' # Apache-2.0 https://github.com/gogo/googleapis/blob/master/LICENSE
)

# These lines in the output should be ignored (plain text, no regex).
Expand Down
4 changes: 2 additions & 2 deletions licenses/list-licenses
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ if [ -f go.mod ]; then
echo "No Go modules found" >&2
else
# Workaround until https://github.com/google/go-licenses/issues/307 is fixed
# .bin/go-licenses report "$module_name" --template .bin/license-template-go.tpl 2>/dev/null
# "${bin_dir}"/go-licenses report "$module_name" --template "${bin_dir}"/license-template-go.tpl 2>/dev/null
#
echo "$go_modules" | xargs -I {} sh -c '.bin/go-licenses report --template .bin/license-template-go.tpl {}' | grep -v '^$'
echo "$go_modules" | xargs -I {} sh -c '"${bin_dir}"/go-licenses report --template "${bin_dir}"/license-template-go.tpl {}' | grep -v '^$'
echo
fi
fi