From ec63dee0af8be6e4461e3295ab28e725ef519c4e Mon Sep 17 00:00:00 2001 From: Jamie Hannaford Date: Wed, 7 Jun 2017 12:47:28 +0100 Subject: Add way to gen one sig --- Makefile | 11 +++++++---- generator/README.md | 9 +++++++++ generator/app.go | 6 ++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d0cc2941..2576804f 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,15 @@ all: \ - build-sigdocs \ - run-sigdocs \ + build-image \ + gen-docs \ reset-docs: git checkout HEAD -- sig-list.md sig-* -build-sigdocs: +build-image: docker build -t sigdocs -f generator/Dockerfile generator -run-sigdocs: +gen-doc: + docker run -e SIG=${SIG} -v $(shell pwd):/go/src/app sigdocs + +gen-docs: docker run -v $(shell pwd):/go/src/app sigdocs diff --git a/generator/README.md b/generator/README.md index d0333c97..94d2af5b 100644 --- a/generator/README.md +++ b/generator/README.md @@ -17,6 +17,15 @@ To (re)build documentation for all the SIGs, run these commands: make all ``` +To build docs for one SIG, run these commands: + +```bash +make SIG=sig-apps gen-doc +make SIG=sig-testing gen-doc +``` + +where the `SIG` var refers to the directory being built. + ## Adding custom content to your SIG's README If your SIG wishes to add custom content, you can do so by placing it within diff --git a/generator/app.go b/generator/app.go index e6335b0a..1ece9685 100644 --- a/generator/app.go +++ b/generator/app.go @@ -179,9 +179,15 @@ func writeLastGenerated(f *os.File) { } func createReadmeFiles(ctx SigEntries) error { + selectedSig := os.Getenv("SIG") for _, sig := range ctx.Sigs { dirName := fmt.Sprintf("sig-%s", strings.ToLower(strings.Replace(sig.Name, " ", "-", -1))) + if selectedSig != "" && selectedSig != dirName { + fmt.Printf("Skipping %s\n", dirName) + continue + } + createDirIfNotExists(dirName) prefix := sig.Contact.GithubTeamPrefix -- cgit v1.2.3