Skip to content

Simpler credits #3444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 10 additions & 9 deletions hack/gen_statik.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,23 @@ set -euo pipefail
export GOFLAGS="-mod=vendor"
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
BIN=${DIR}/bin
LICENSES=${BIN}/licenses
STATIK=${BIN}/statik

mkdir -p ${BIN}

if ! [[ -f ${LICENSES} ]]; then
pushd ${DIR}/tools
echo >&2 'Installing licenses tool'
GOBIN=${BIN} GO111MODULE=on go install -tags tools github.com/google/trillian/scripts/licenses
popd
fi

TMP_DIR=$(mktemp -d)
trap "rm -rf $TMP_DIR" EXIT

${LICENSES} save "github.com/GoogleContainerTools/skaffold/cmd/skaffold" --save_path="${TMP_DIR}/skaffold-credits"
# Copy licenses
pushd vendor
LICENSES=$(find . \( -type f -name 'LICENSE*' -or -name 'COPYING*' -or -name 'NOTICE*' \))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integrating with licenses is important and was intentional, so that we don't have to maintain this logic.
This line does not cover the logic of licenses. For example there is a requirement that Mozilla Public License licenses need to include the source as well.

The package moved to https://github.com/google/go-licenses and we will have to switch over to that. But I'd rather use that then this logic. This gives us flexibility and maintainability on the long run as well, e.g. if we switch over to downloading go modules instead of vendor directory, the library will work just as well, while this line will break.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Makes sense. I tried https://github.com/google/go-license and it's slow as hell now. We need to find a way to make it faster or to make it not run each time we make install

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean slow as hell?

for LICENSE in $LICENSES; do
mkdir -p "$(dirname "${TMP_DIR}/skaffold-credits/$LICENSE")"
cp $LICENSE ${TMP_DIR}/skaffold-credits/$LICENSE
done
popd

# Copy schemas
cp -R docs/content/en/schemas "${TMP_DIR}/schemas"

if ! [[ -f ${STATIK} ]]; then
Expand Down
2 changes: 0 additions & 2 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ go 1.13

require (
github.com/corneliusweig/release-notes v0.0.0-20191014214505-0be5c7c66752
github.com/google/licenseclassifier v0.0.0-20190926221455-842c0d70d702 // indirect
github.com/google/trillian v1.3.2-0.20191031155000-9600d042b2e7
github.com/rakyll/statik v0.1.6
)
445 changes: 0 additions & 445 deletions hack/tools/go.sum

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion hack/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ package main

import (
_ "github.com/corneliusweig/release-notes"
_ "github.com/google/trillian/scripts/licenses"
_ "github.com/rakyll/statik"
)
42 changes: 0 additions & 42 deletions hack/tools/vendor.sh

This file was deleted.

41 changes: 0 additions & 41 deletions hack/tools/vendor/github.com/emirpasic/gods/LICENSE

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading