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
88548e22
Commit
88548e22
authored
Oct 26, 2015
by
Nikhil Jindal
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16059 from nikhiljindal/fixVersionizeScripts
Fixing versionize docs to version more files and run update-api-reference-docs.sh
parents
b07dd73f
8234d131
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
7 deletions
+25
-7
versionize-docs.sh
build/versionize-docs.sh
+25
-7
No files found.
build/versionize-docs.sh
View file @
88548e22
...
...
@@ -49,27 +49,45 @@ HTML_PREVIEW_PREFIX="https://htmlpreview.github.io/\?https://github.com/kubernet
md_dirs
=(
docs examples
)
md_files
=()
for
dir
in
"
${
md_dirs
[@]
}
"
;
do
mdfiles+
=(
$(
find
"
${
dir
}
"
-name
"*.md"
-type
f
)
)
md
_
files+
=(
$(
find
"
${
dir
}
"
-name
"*.md"
-type
f
)
)
done
for
doc
in
"
${
mdfiles
[@]
}
"
;
do
for
doc
in
"
${
md
_
files
[@]
}
"
;
do
$SED
-ri
\
-e
'/<!-- BEGIN STRIP_FOR_RELEASE -->/,/<!-- END STRIP_FOR_RELEASE -->/d'
\
-e
"s|(releases.k8s.io)/[^/]+|
\1
/
${
NEW_VERSION
}
|g"
\
"
${
doc
}
"
# Replace /HEAD in html preview links with /NEW_VERSION.
$SED
-ri
-e
"s|(
${
HTML_PREVIEW_PREFIX
}
/HEAD)|
${
HTML_PREVIEW_PREFIX
}
/
${
NEW_VERSION
}
|
"
"
${
doc
}
"
$SED
-ri
-e
"s|(
${
HTML_PREVIEW_PREFIX
}
)/HEAD|
\1
/blob/
${
NEW_VERSION
}
|g
"
"
${
doc
}
"
is_versioned_tag
=
"<!-- BEGIN MUNGE: IS_VERSIONED -->
<!-- TAG IS_VERSIONED -->
<!-- END MUNGE: IS_VERSIONED -->"
<!-- TAG IS_VERSIONED -->
<!-- END MUNGE: IS_VERSIONED -->"
if
!
grep
-q
"
${
is_versioned_tag
}
"
"
${
doc
}
"
;
then
echo
-e
"
\n\n
${
is_versioned_tag
}
\n\n
"
>>
"
${
doc
}
"
fi
done
# Update API descriptions to match this version.
$SED
-ri
-e
"s|(releases.k8s.io)/[^/]+|
\1
/
${
NEW_VERSION
}
|"
pkg/api/v[0-9]
*
/types.go
# Update kubectl cmd files so that kubectl docs generated from them are as
# expected.
go_dirs
=(
pkg/kubectl/cmd
)
go_files
=()
for
dir
in
"
${
go_dirs
[@]
}
"
;
do
go_files+
=(
$(
find
"
${
dir
}
"
-name
"*.go"
-type
f
)
)
done
# Update API descriptions as well
go_files+
=(
pkg/api/v[0-9]
*
/types.go
)
go_files+
=(
pkg/api/unversioned/types.go
)
go_files+
=(
pkg/apis/
*
/v[0-9]
*
/types.go
)
go_files+
=(
pkg/apis/
*
/types.go
)
for
file
in
"
${
go_files
[@]
}
"
;
do
$SED
-ri
\
-e
"s|(releases.k8s.io)/[^/]+|
\1
/
${
NEW_VERSION
}
|g"
\
-e
"s|(
${
HTML_PREVIEW_PREFIX
}
)/HEAD)|
\1
/blob/
${
NEW_VERSION
}
|g"
\
"
${
file
}
"
done
${
KUBE_ROOT
}
/hack/update-generated-docs.sh
${
KUBE_ROOT
}
/hack/update-generated-swagger-docs.sh
./hack/update-api-reference-docs.sh
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