Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
add provisional API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
luxas committed Jul 4, 2019
1 parent 654079f commit 218c947
Show file tree
Hide file tree
Showing 3 changed files with 958 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ PROJECT = github.com/weaveworks/ignite
APIS_DIR = ${PROJECT}/pkg/apis
API_DIRS = ${APIS_DIR}/ignite/v1alpha1,${APIS_DIR}/meta/v1alpha1
CACHE_DIR = $(shell pwd)/bin/cache
API_DOCS = docs/api-reference/ignite.md docs/api-reference/meta.md

all: binary
binary:
Expand Down Expand Up @@ -39,14 +40,26 @@ ifeq ($(IS_DIRTY),0)
docker push ${DOCKER_USER}/ignite:${GIT_VERSION}
endif

tidy:
tidy: $(API_DOCS)
go mod tidy
go mod vendor
gofmt -s -w pkg cmd
goimports -w pkg cmd
hack/generate-client.sh
go run hack/cobra.go

.PHONY: $(API_DOCS)
$(API_DOCS): docs/api-reference/%.md: $(CACHE_DIR)/go/bin/godoc2md
mkdir -p $$(dirname $@) bin/tmp/$*
mv $(shell pwd)/pkg/apis/$*/v1alpha1/zz_generated* bin/tmp/$*
$(MAKE) shell COMMAND="/go/bin/godoc2md /go/src/${PROJECT}/pkg/apis/$*/v1alpha1 > $@"
mv bin/tmp/$*/*.go $(shell pwd)/pkg/apis/$*/v1alpha1/
rm -r bin/tmp/$*

$(CACHE_DIR)/go/bin/godoc2md:
curl -sSL https://github.com/luxas/godoc2md/releases/download/v0.1.0/godoc2md > $@
chmod +x $@

shell:
mkdir -p $(CACHE_DIR)/go $(CACHE_DIR)/cache
docker run -it \
Expand Down
Loading

0 comments on commit 218c947

Please sign in to comment.