From 4a1f68427b086d732d893c7460d1d6645b3dc090 Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Fri, 5 Jul 2024 12:12:33 +0200 Subject: [PATCH] install license detector --- .../{NOTICE.MD.tmpl => NOTICE.txt.tmpl} | 2 +- .github/templates/dependencies.asciidoc.tmpl | 51 +++++++++++++++++++ .github/workflows/generate-notice.yml | 7 +-- 3 files changed, 56 insertions(+), 4 deletions(-) rename .github/templates/{NOTICE.MD.tmpl => NOTICE.txt.tmpl} (92%) create mode 100644 .github/templates/dependencies.asciidoc.tmpl diff --git a/.github/templates/NOTICE.MD.tmpl b/.github/templates/NOTICE.txt.tmpl similarity index 92% rename from .github/templates/NOTICE.MD.tmpl rename to .github/templates/NOTICE.txt.tmpl index f4903194d..b58a23740 100644 --- a/.github/templates/NOTICE.MD.tmpl +++ b/.github/templates/NOTICE.txt.tmpl @@ -10,7 +10,7 @@ Licence : {{ $dep.LicenceType }} {{ end }} {{- end -}} -Copyright 2022-{{ currentYear }} Quesma +Copyright 2019-{{ currentYear }} Quesma Inc This product includes software developed by The Apache Software Foundation (http://www.apache.org/). diff --git a/.github/templates/dependencies.asciidoc.tmpl b/.github/templates/dependencies.asciidoc.tmpl new file mode 100644 index 000000000..98cd3bdd7 --- /dev/null +++ b/.github/templates/dependencies.asciidoc.tmpl @@ -0,0 +1,51 @@ +{{- define "depRow" -}} +{{- range $i, $dep := . }} +| link:{{ $dep.URL }}[$${{ $dep.Name }}$$] | {{ $dep.Version }} | {{ $dep.LicenceType }} +{{- end }} +{{- end -}} +// Generated documentation. Please do not edit. +:page_id: dependencies +ifdef::env-github[] +**** +link:https://www.elastic.co/guide/en/cloud-on-k8s/master/k8s-{page_id}.html[View this document on the Elastic website] +**** +endif::[] + +[id="{p}-{page_id}"] += Third-party dependencies + +This page lists the third-party dependencies used to build {n}. + +[float] +[id="{p}-dependencies-direct"] +== Direct dependencies + +[options="header"] +|=== +| Name | Version | Licence +{{ template "depRow" .Direct }} +|=== + +{{ if .Indirect }} +[float] +[id="{p}-dependencies-indirect"] +== Indirect dependencies + +[options="header"] +|=== +| Name | Version | Licence +{{ template "depRow" .Indirect }} +|=== +{{ end }} + +[float] +[id="{p}-dependencies-image"] +== Container image dependencies + +Dependencies included in the {n} container image. + +[options="header",format="csv"] +|=== +Name, Version, Licence, URL +include::container-image-dependencies.csv[] +|=== diff --git a/.github/workflows/generate-notice.yml b/.github/workflows/generate-notice.yml index dad1fa0c3..74b16248f 100644 --- a/.github/workflows/generate-notice.yml +++ b/.github/workflows/generate-notice.yml @@ -21,12 +21,13 @@ jobs: - name: Install go-licence-detector working-directory: ${{ matrix.module }} - run: go get go.elastic.co/go-licence-detector + run: go install go.elastic.co/go-licence-detector - name: Print Dependencies working-directory: ${{ matrix.module }} run: | - go list -m -json all | go-licence-detector -includeIndirect -depsOut=dependencies.asciidoc -noticeOut=NOTICE.txt - cat NOTICE.txt + go list -m -json all | go-licence-detector -includeIndirect -noticeTemplate=.github/templates/NOTICE.txt.tmpl -noticeOut=NOTICE.txt -depsTemplate=.github/templates/dependencies.asciidoc.tmpl -depsOut=dependencies.asciidoc cat dependencies.asciidoc + cat NOTICE.txt +