2023-06-11 13:27:59 +00:00
|
|
|
VER_FONTAWESOME:=6.4.0
|
2018-05-05 16:09:37 +00:00
|
|
|
|
|
|
|
|
2021-09-08 15:43:24 +00:00
|
|
|
default: generate download_libs
|
2018-05-05 16:09:37 +00:00
|
|
|
|
2023-08-15 11:38:24 +00:00
|
|
|
build-local: download_libs generate-inner generate-apidocs
|
|
|
|
go build \
|
|
|
|
-buildmode=pie \
|
|
|
|
-ldflags "-s -w -X main.version=$(git describe --tags --always || echo dev)" \
|
|
|
|
-mod=readonly \
|
|
|
|
-trimpath
|
|
|
|
|
2021-09-08 15:43:24 +00:00
|
|
|
generate:
|
2023-06-10 12:50:21 +00:00
|
|
|
docker run --rm -i -v $(CURDIR):$(CURDIR) -w $(CURDIR) node:18-alpine \
|
|
|
|
sh -exc "apk add make && make generate-inner generate-apidocs && chown -R $(shell id -u) frontend node_modules"
|
2021-09-26 22:52:44 +00:00
|
|
|
|
|
|
|
generate-apidocs:
|
2023-08-15 11:38:24 +00:00
|
|
|
npx --yes @redocly/cli build-docs docs/openapi.yaml --disableGoogleFont true -o /tmp/api.html
|
2023-03-07 15:09:04 +00:00
|
|
|
mv /tmp/api.html frontend/
|
2021-09-26 12:49:18 +00:00
|
|
|
|
|
|
|
generate-inner:
|
2023-09-30 17:59:09 +00:00
|
|
|
npx --yes npm@latest ci --include=dev
|
2023-06-10 12:50:21 +00:00
|
|
|
node ./ci/build.mjs
|
2017-08-03 16:33:56 +00:00
|
|
|
|
2023-06-10 12:50:21 +00:00
|
|
|
publish: download_libs generate-inner generate-apidocs
|
2023-10-04 20:27:14 +00:00
|
|
|
bash ./ci/build.sh
|
2018-05-05 16:09:37 +00:00
|
|
|
|
2023-06-18 15:09:37 +00:00
|
|
|
translate:
|
2023-10-05 13:29:06 +00:00
|
|
|
cd ci/translate && go run . --write-issue-file
|
2023-06-18 15:09:37 +00:00
|
|
|
|
2018-05-05 16:09:37 +00:00
|
|
|
# -- Download / refresh external libraries --
|
|
|
|
|
|
|
|
clean_libs:
|
2021-09-08 15:43:24 +00:00
|
|
|
rm -rf \
|
|
|
|
frontend/css \
|
|
|
|
frontend/js \
|
|
|
|
frontend/webfonts
|
|
|
|
|
|
|
|
download_libs: clean_libs
|
|
|
|
download_libs: fontawesome
|
2018-05-05 16:09:37 +00:00
|
|
|
|
|
|
|
fontawesome:
|
|
|
|
curl -sSfL https://github.com/FortAwesome/Font-Awesome/archive/$(VER_FONTAWESOME).tar.gz | \
|
2019-05-10 14:19:38 +00:00
|
|
|
tar -vC frontend -xz --strip-components=1 --wildcards --exclude='*/js-packages' '*/css' '*/webfonts'
|
2023-06-11 13:27:59 +00:00
|
|
|
|
|
|
|
# -- Vulnerability scanning --
|
|
|
|
|
|
|
|
trivy:
|
|
|
|
trivy fs . \
|
|
|
|
--dependency-tree \
|
|
|
|
--exit-code 1 \
|
|
|
|
--format table \
|
|
|
|
--ignore-unfixed \
|
|
|
|
--quiet \
|
|
|
|
--scanners config,license,secret,vuln \
|
|
|
|
--severity HIGH,CRITICAL \
|
|
|
|
--skip-dirs docs
|