Skip to content

Commit

Permalink
Fix containerized generation
Browse files Browse the repository at this point in the history
  • Loading branch information
cblecker committed Feb 19, 2024
1 parent 44086e9 commit c7da084
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
IMAGE_NAME=golang:1.18
export GOPROXY?=https://proxy.golang.org
CONTAINER_ENGINE?=$(shell command -v docker 2>/dev/null || command -v podman 2>/dev/null)

default: \
generate \
Expand All @@ -10,19 +10,19 @@ reset-docs:
generate:
go run ./generator/app.go

generate-dockerized:
docker run --rm -e WHAT -e GOPROXY -v $(shell pwd):/go/src/app:Z $(IMAGE_NAME) make -C /go/src/app generate
generate-containerized:
$(CONTAINER_ENGINE) run --rm -e WHAT -v $(shell pwd):/go/src/app $(IMAGE_NAME) make -C /go/src/app generate

verify:
@hack/verify.sh

verify-dockerized:
docker run --rm -v $(shell pwd):/go/src/app:Z $(IMAGE_NAME) make -C /go/src/app verify
verify-containerized:
$(CONTAINER_ENGINE) run --rm -v $(shell pwd):/go/src/app $(IMAGE_NAME) make -C /go/src/app verify

test:
go test -v ./generator/...

test-dockerized:
docker run --rm -v $(shell pwd):/go/src/app:Z $(IMAGE_NAME) make -C /go/src/app test
test-containerized:
$(CONTAINER_ENGINE) run --rm -v $(shell pwd):/go/src/app $(IMAGE_NAME) make -C /go/src/app test

.PHONY: default reset-docs generate generate-dockerized verify test test-dockerized
.PHONY: default reset-docs generate generate-containerized verify verify-containerized test test-containerized
6 changes: 3 additions & 3 deletions generator/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SIG Doc builder

This folder contains scripts to automatically generate documentation about the
different Special Interest Groups (SIGs), Working Groups (WGs)
different Special Interest Groups (SIGs), Working Groups (WGs)
and Committees of Kubernetes. The authoritative
source for SIG information is the [`sigs.yaml`](/sigs.yaml) file in the project root.
All updates must be done there.
Expand Down Expand Up @@ -49,9 +49,9 @@ To (re)build documentation for all the SIGs in a go environment, run:
```bash
make generate
```
or to run this inside a docker container:
or to run this inside a container:
```bash
make generate-dockerized
make generate-containerized
```

To build docs for one SIG, run one of these commands:
Expand Down
2 changes: 1 addition & 1 deletion hack/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fi
# Excluded check patterns are always skipped.
EXCLUDED_PATTERNS=(
"verify-all.sh" # this script calls the make rule and would cause a loop
"verify-*-dockerized.sh" # Don't run any scripts that intended to be run dockerized
"verify-*-containerized.sh" # Don't run any scripts that intended to be run containerized
)

EXCLUDED_CHECKS=$(ls ${EXCLUDED_PATTERNS[@]/#/${KUBE_ROOT}\/hack\/} 2>/dev/null || true)
Expand Down

0 comments on commit c7da084

Please sign in to comment.