Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
6f6e97f2
Commit
6f6e97f2
authored
Dec 04, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17987 from mml/mungedocs
Auto commit by PR queue bot
parents
a5100ef0
08418a48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
mungedocs.go
cmd/mungedocs/mungedocs.go
+5
-0
verify-generated-docs.sh
hack/after-build/verify-generated-docs.sh
+3
-2
No files found.
cmd/mungedocs/mungedocs.go
View file @
6f6e97f2
...
...
@@ -29,6 +29,7 @@ import (
)
var
(
verbose
=
flag
.
Bool
(
"verbose"
,
false
,
"On verification failure, emit pre-munge and post-munge versions."
)
verify
=
flag
.
Bool
(
"verify"
,
false
,
"Exit with status 1 if files would have needed changes but do not change."
)
rootDir
=
flag
.
String
(
"root-dir"
,
""
,
"Root directory containing documents to be processed."
)
// "repo-root" seems like a dumb name, this is the relative path (from rootDir) to get to the repoRoot
...
...
@@ -108,6 +109,10 @@ func (f fileProcessor) visit(path string) error {
filePrinted
=
true
}
fmt
.
Printf
(
"%s:
\n
"
,
munge
.
name
)
if
*
verbose
{
fmt
.
Printf
(
"INPUT: <<<%v>>>
\n
"
,
mungeLines
)
fmt
.
Printf
(
"MUNGED: <<<%v>>>
\n
"
,
after
)
}
if
err
!=
nil
{
fmt
.
Println
(
err
)
errFound
=
true
...
...
hack/after-build/verify-generated-docs.sh
View file @
6f6e97f2
...
...
@@ -35,7 +35,8 @@ EXAMPLEROOT="${KUBE_ROOT}/examples/"
# mungedocs --verify can (and should) be run on the real docs, otherwise their
# links will be distorted. --verify means that it will not make changes.
"
${
mungedocs
}
"
"--verify=true"
"--root-dir=
${
DOCROOT
}
"
&&
ret
=
0
||
ret
=
$?
# --verbose gives us output we can use for a diff.
"
${
mungedocs
}
"
"--verify=true"
"--verbose=true"
"--root-dir=
${
DOCROOT
}
"
&&
ret
=
0
||
ret
=
$?
if
[[
$ret
-eq
1
]]
;
then
echo
"
${
DOCROOT
}
is out of date. Please run hack/update-generated-docs.sh"
exit
1
...
...
@@ -45,7 +46,7 @@ if [[ $ret -gt 1 ]]; then
exit
1
fi
"
${
mungedocs
}
"
"--verify=true"
"--root-dir=
${
EXAMPLEROOT
}
"
&&
ret
=
0
||
ret
=
$?
"
${
mungedocs
}
"
"--verify=true"
"--
verbose=true"
"--
root-dir=
${
EXAMPLEROOT
}
"
&&
ret
=
0
||
ret
=
$?
if
[[
$ret
-eq
1
]]
;
then
echo
"
${
EXAMPLEROOT
}
is out of date. Please run hack/update-generated-docs.sh"
exit
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment