-
Notifications
You must be signed in to change notification settings - Fork 402
fix CLI reference generation for current and next versions #811
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,18 +63,20 @@ gencliversions="${1:-0}" | |
| genversion() { | ||
| checkout "$1" | ||
| gendocs "$2" | ||
| } | ||
|
|
||
| genversionwithcli() { | ||
| genversion "$1" "$2" | ||
|
|
||
| if [ "$gencliversions" == 1 ]; then | ||
| genclireference "$2" "cmd/acmesolver" "acmesolver" | ||
| genclireference "$2" "cmd/cainjector" "cainjector" | ||
| genclireference "$2" "cmd/ctl" "cmctl" | ||
| genclireference "$2" "cmd/controller" "controller" | ||
| genclireference "$2" "cmd/webhook" "webhook" | ||
|
|
||
| # if any of the above steps succeeded copy over the index file | ||
| if [ -d "$REPO_ROOT/content/en/$2/cli" ]; then | ||
| cp "$REPO_ROOT/content/en/docs/cli/_index.md" "${REPO_ROOT}/content/en/$2/cli/" | ||
| fi | ||
| genclireference "$2" "cmd/acmesolver" "acmesolver" | ||
| genclireference "$2" "cmd/cainjector" "cainjector" | ||
| genclireference "$2" "cmd/ctl" "cmctl" | ||
| genclireference "$2" "cmd/controller" "controller" | ||
| genclireference "$2" "cmd/webhook" "webhook" | ||
|
|
||
| # if any of the above steps succeeded copy over the index file | ||
| if [ -d "$REPO_ROOT/content/en/$2/cli" ]; then | ||
| cp "$REPO_ROOT/content/en/docs/cli/_index.md" "${REPO_ROOT}/content/en/$2/cli/" | ||
| fi | ||
| } | ||
|
|
||
|
|
@@ -142,21 +144,22 @@ $output | |
| EOF | ||
| } | ||
|
|
||
| genclireference "docs" "cmd/acmesolver" "acmesolver" | ||
| genclireference "docs" "cmd/cainjector" "cainjector" | ||
| genclireference "docs" "cmd/ctl" "cmctl" | ||
| genclireference "docs" "cmd/controller" "controller" | ||
| genclireference "docs" "cmd/webhook" "webhook" | ||
|
|
||
| # The branches named here exist in the `jetstack/cert-manager` repo. | ||
|
|
||
| genversion "release-1.7" "next-docs" | ||
| genversionwithcli "release-1.7" "next-docs" | ||
|
|
||
| # In cert-manager 1.6 cert-manager.io and acme.cert-manager.io alpha and beta | ||
| # API versions are no longer served, but the apis are still in the codebase. We | ||
| # don't want to show the docs for those API versions so this is a workaround. | ||
| # This will only be necessary for the release-1.6 branch. | ||
| checkout "release-1.6" | ||
|
|
||
| genclireference "docs" "cmd/acmesolver" "acmesolver" | ||
| genclireference "docs" "cmd/cainjector" "cainjector" | ||
| genclireference "docs" "cmd/ctl" "cmctl" | ||
| genclireference "docs" "cmd/controller" "controller" | ||
| genclireference "docs" "cmd/webhook" "webhook" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And if these lines are deliberately placed after the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added a comment here covering this! |
||
|
|
||
| rm -r pkg/apis/acme/v1alpha2 | ||
| rm -r pkg/apis/acme/v1alpha3 | ||
| rm -r pkg/apis/acme/v1beta1 | ||
|
|
@@ -174,9 +177,9 @@ rm -r pkg/apis/certmanager/v1alpha3 | |
| rm -r pkg/apis/certmanager/v1beta1 | ||
| gendocs "v1.6-docs" | ||
|
|
||
| # when adding a new version here run | ||
| # ./scripts/gendocs/generate 1 to force generation of CLI docs | ||
| # and add them to the git index | ||
| # when adding a new version here use | ||
| # genversionwithcli to force generation of CLI docs | ||
| # and add them to the git index, then switch back to genversion | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this comment.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have re-formulated the comment and included an example for the next change in this section |
||
| genversion "release-1.5" "v1.5-docs" | ||
| genversion "release-1.4" "v1.4-docs" | ||
| genversion "release-1.3" "v1.3-docs" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
checkoutand the comment above relate to thermandgendocscommand below,so I think it the
genclireferencecommands should be moved after those.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I have moved the comment.
genclireferencemust happen before we delete the legacy API versions because the code does not compile without them. I added a comment on that as well