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
819cbbef
Commit
819cbbef
authored
Oct 29, 2015
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix versionize-docs.sh and mark-new-version.sh to rewrite links to release…
fix versionize-docs.sh and mark-new-version.sh to rewrite links to release branch rather than to tag
parent
92572d92
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
mark-new-version.sh
build/mark-new-version.sh
+3
-2
versionize-docs.sh
build/versionize-docs.sh
+11
-10
No files found.
build/mark-new-version.sh
View file @
819cbbef
...
@@ -96,8 +96,9 @@ if ! ($SED --version 2>&1 | grep -q GNU); then
...
@@ -96,8 +96,9 @@ if ! ($SED --version 2>&1 | grep -q GNU); then
fi
fi
echo
"+++ Running ./versionize-docs"
echo
"+++ Running ./versionize-docs"
${
KUBE_ROOT
}
/build/versionize-docs.sh
${
NEW_VERSION
}
# Links in docs should always point to the release branch.
git commit
-am
"Versioning docs and examples for
${
VERSION_MAJOR
}
.
${
VERSION_MINOR
}
.
${
VERSION_PATCH
}
"
${
KUBE_ROOT
}
/build/versionize-docs.sh
${
release_branch
}
git commit
-am
"Versioning docs and examples to
${
release_branch
}
"
VERSION_FILE
=
"
${
KUBE_ROOT
}
/pkg/version/base.go"
VERSION_FILE
=
"
${
KUBE_ROOT
}
/pkg/version/base.go"
...
...
build/versionize-docs.sh
View file @
819cbbef
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
# Updates the docs to be ready to be used as release docs for a particular
# Updates the docs to be ready to be used as release docs for a particular
# version.
# version.
# Example usage:
# Example usage:
# ./versionize-docs.sh
v1.0
.1
# ./versionize-docs.sh
release-1
.1
set
-o
errexit
set
-o
errexit
set
-o
nounset
set
-o
nounset
...
@@ -25,13 +25,14 @@ set -o pipefail
...
@@ -25,13 +25,14 @@ set -o pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
NEW_VERSION
=
${
1
-
}
RELEASE_BRANCH
=
${
1
-
}
#
NEW_VERSION is expected to be vMajor.Minor.Micro.
#
MAJOR_AND_MINOR_VERSION is expected to be something like "v1.1"
MAJOR_AND_MINOR_VERSION
=
${
NEW_VERSION
%.*
}
MAJOR_AND_MINOR_VERSION
=
"v
${
RELEASE_BRANCH
#release-
}
"
if
[
"$#"
-lt
1
]
;
then
if
[
"$#"
-lt
1
]
;
then
echo
"Usage: versionize-docs <release-version>"
echo
"Usage: versionize-docs.sh <release-branch>, e.g., versionize-docs.sh release-1.1."
echo
"The <release-branch> is used to rewrites link URL, which should always point to a release branch, NOT a tag like v1.1.1."
exit
1
exit
1
fi
fi
...
@@ -59,11 +60,11 @@ done
...
@@ -59,11 +60,11 @@ done
for
doc
in
"
${
md_files
[@]
}
"
;
do
for
doc
in
"
${
md_files
[@]
}
"
;
do
$SED
-ri
\
$SED
-ri
\
-e
'/<!-- BEGIN STRIP_FOR_RELEASE -->/,/<!-- END STRIP_FOR_RELEASE -->/d'
\
-e
'/<!-- BEGIN STRIP_FOR_RELEASE -->/,/<!-- END STRIP_FOR_RELEASE -->/d'
\
-e
"s|(releases.k8s.io)/[^/]+|
\1
/
${
NEW_VERSION
}
|g"
\
-e
"s|(releases.k8s.io)/[^/]+|
\1
/
${
RELEASE_BRANCH
}
|g"
\
"
${
doc
}
"
"
${
doc
}
"
# Replace /HEAD in html preview links with /
NEW_VERSION.
# Replace /HEAD in html preview links with /
RELEASE_BRANCH
$SED
-ri
-e
"s|(
${
HTML_PREVIEW_PREFIX
}
)/HEAD|
\1
/
blob/
${
NEW_VERSION
}
|g"
"
${
doc
}
"
$SED
-ri
-e
"s|(
${
HTML_PREVIEW_PREFIX
}
)/HEAD|
\1
/
${
RELEASE_BRANCH
}
|g"
"
${
doc
}
"
# Replace <REPLACE-WITH-RELEASE-VERSION> with MAJOR_AND_MINOR_VERSION.
# Replace <REPLACE-WITH-RELEASE-VERSION> with MAJOR_AND_MINOR_VERSION.
$SED
-ri
-e
"s|
${
DIRECTORY_KEY_WORDS
}
|
${
MAJOR_AND_MINOR_VERSION
}
|g"
"
${
doc
}
"
$SED
-ri
-e
"s|
${
DIRECTORY_KEY_WORDS
}
|
${
MAJOR_AND_MINOR_VERSION
}
|g"
"
${
doc
}
"
...
@@ -91,8 +92,8 @@ go_files+=(pkg/apis/*/types.go)
...
@@ -91,8 +92,8 @@ go_files+=(pkg/apis/*/types.go)
for
file
in
"
${
go_files
[@]
}
"
;
do
for
file
in
"
${
go_files
[@]
}
"
;
do
$SED
-ri
\
$SED
-ri
\
-e
"s|(releases.k8s.io)/[^/]+|
\1
/
${
NEW_VERSION
}
|g"
\
-e
"s|(releases.k8s.io)/[^/]+|
\1
/
${
RELEASE_BRANCH
}
|g"
\
-e
"s|(
${
HTML_PREVIEW_PREFIX
}
)/HEAD|
\1
/
blob/
${
NEW_VERSION
}
|g"
\
-e
"s|(
${
HTML_PREVIEW_PREFIX
}
)/HEAD|
\1
/
${
RELEASE_BRANCH
}
|g"
\
"
${
file
}
"
"
${
file
}
"
done
done
...
...
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