Skip to content

Commit

Permalink
build: include licenses information into distributed artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
joshiste committed Sep 19, 2023
1 parent f4fa412 commit 5eba0f3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/gpg.key
/dist
go.docker.mod
/licenses
4 changes: 3 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ project_name: steadybit-extension-http
before:
hooks:
- go mod download
- make licenses-report
release:
prerelease: "false"
builds:
Expand Down Expand Up @@ -58,7 +59,8 @@ nfpms:
- src: ./linuxpkg/config
dst: /etc
type: config

- src: ./licenses
dst: /opt/steadybit/extension-http/licenses
scripts:
preinstall: ./linuxpkg/scripts/preinstall.sh
postinstall: ./linuxpkg/scripts/postinstall.sh
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ USER $USERNAME
WORKDIR /

COPY --from=build /app/extension /extension
COPY --from=build /app/licenses /licenses

EXPOSE 8085 8081

Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected] save . --save_path ./licenses
go run github.com/google/[email protected] report . > ./licenses/THIRD-PARTY.csv
cp LICENSE ./licenses/LICENSE.txt

# ==================================================================================== #
# QUALITY CONTROL
Expand Down Expand Up @@ -61,6 +68,7 @@ container:
git tag -d $$(git tag -l | grep -v "^v[0-9]*.[0-9]*.[0-9]*") # delete all tags locally that are not semver
docker buildx build --build-arg BUILD_WITH_COVERAGE="true" -t extension-http:latest --output=type=docker .

## linuxpkg: build the linux packages
.PHONY: linuxpkg
linuxpkg:
goreleaser release --clean --snapshot --skip-sign

0 comments on commit 5eba0f3

Please sign in to comment.