Skip to content
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

Implement deadlink checker for vald web #2643

Merged
merged 7 commits into from
Sep 30, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ MIRROR_GATEWAY_IMAGE = $(NAME)-mirror-gateway
READREPLICA_ROTATE_IMAGE = $(NAME)-readreplica-rotate
MAINTAINER = "$(ORG).org $(NAME) team <$(NAME)@$(ORG).org>"

DEADLINK_CHECK_PATH ?= ""
DEADLINK_IGNORE_PATH ?= ""
DEADLINK_CHECK_FORMAT = html

DEFAULT_BUILDKIT_SYFT_SCANNER_IMAGE = $(GHCRORG)/$(BUILDKIT_SYFT_SCANNER_IMAGE):nightly

VERSION ?= $(eval VERSION := $(shell cat versions/VALD_VERSION))$(VERSION)
Expand Down Expand Up @@ -447,6 +451,11 @@ dockerfile:
workflow:
$(call gen-workflow,$(ROOTDIR),$(MAINTAINER))

.PHONY: deadlink-checker
## generate deadlink-checker
deadlink-checker:
$(call gen-deadlink-checker,$(ROOTDIR),$(MAINTAINER),$(DEADLINK_CHECK_PATH),$(DEADLINK_IGNORE_PATH),$(DEADLINK_CHECK_FORMAT))

.PHONY: init
## initialize development environment
init: \
Expand Down
17 changes: 17 additions & 0 deletions Makefile.d/functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,20 @@ define update-github-actions
done
endef

define gen-deadlink-checker
BIN_PATH="$(TEMP_DIR)/vald-deadlink-checker-gen"; \
rm -rf $$BIN_PATH; \
MAINTAINER=$2 \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
go build -modcacherw \
-mod=readonly \
-a \
-tags "osusergo netgo static_build" \
-trimpath \
-o $$BIN_PATH $(ROOTDIR)/hack/tools/deadlink/main.go; \
$$BIN_PATH -path $3 -ignore-path $4 -format $5 $1; \
rm -rf $$BIN_PATH
endef

Loading
Loading