diff --git a/licenses/install b/licenses/install index 4feda35..290f056 100755 --- a/licenses/install +++ b/licenses/install @@ -1,14 +1,33 @@ #!/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 @@ -16,7 +35,7 @@ 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 ..." @@ -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 ..." diff --git a/licenses/license-engine.sh b/licenses/license-engine.sh index 38715f7..7d6ec1c 100755 --- a/licenses/license-engine.sh +++ b/licenses/license-engine.sh @@ -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' @@ -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). diff --git a/licenses/list-licenses b/licenses/list-licenses index 8a238d9..5824059 100755 --- a/licenses/list-licenses +++ b/licenses/list-licenses @@ -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