From 053f7af2606f6c00abad265f51caed8ac6bc069e Mon Sep 17 00:00:00 2001 From: Johannes Edmeier Date: Tue, 19 Sep 2023 10:56:59 +0200 Subject: [PATCH] build: include licenses information into distributed artifacts --- .gitignore | 1 + Dockerfile | 2 ++ Makefile | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index b85de7e..dd65e6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /extension-prometheus extension-prometheus.iml /coverage.out +/licenses diff --git a/Dockerfile b/Dockerfile index 754795c..6f6b7a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN go build \ -X 'github.com/steadybit/extension-kit/extbuild.Version=${VERSION}' \ -X 'github.com/steadybit/extension-kit/extbuild.Revision=${REVISION}'" \ -o ./extension +RUN make licenses-report ## ## Runtime @@ -41,6 +42,7 @@ USER $USERNAME WORKDIR / COPY --from=build /app/extension /extension +COPY --from=build /app/licenses /licenses EXPOSE 8087 EXPOSE 8088 diff --git a/Makefile b/Makefile index 6e5f08c..a1c44bb 100755 --- a/Makefile +++ b/Makefile @@ -8,6 +8,13 @@ help: @echo 'Usage:' @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /' +## licenses-report: generate a report of all licenses +.PHONY: licenses-report +licenses-report: + rm -rf ./licenses + go run github.com/google/go-licenses@v1.6.0 save . --save_path ./licenses + go run github.com/google/go-licenses@v1.6.0 report . > ./licenses/THIRD-PARTY.csv + cp LICENSE ./licenses/LICENSE.txt # ==================================================================================== # # QUALITY CONTROL