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
e91b77cb
Commit
e91b77cb
authored
Mar 27, 2015
by
Zach Loafman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6104 from eparis/tag-version
make mark-new-release.sh do branching and tell you exactly what to do ne...
parents
04e49240
cbefaf5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
5 deletions
+36
-5
mark-new-version.sh
build/mark-new-version.sh
+36
-5
No files found.
build/mark-new-version.sh
View file @
e91b77cb
...
@@ -24,7 +24,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
...
@@ -24,7 +24,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
NEW_VERSION
=
${
1
-
}
NEW_VERSION
=
${
1
-
}
VERSION_REGEX
=
"
v([0-9]+).([0-9]+(.[0-9]+)?)
"
VERSION_REGEX
=
"
^v(0|[1-9][0-9]*)
\\
.(0|[1-9][0-9]*)
\\
.(0|[1-9][0-9]*)$
"
[[
${
NEW_VERSION
}
=
~
$VERSION_REGEX
]]
||
{
[[
${
NEW_VERSION
}
=
~
$VERSION_REGEX
]]
||
{
echo
"!!! You must specify the version in the form of '
$VERSION_REGEX
'"
>
&2
echo
"!!! You must specify the version in the form of '
$VERSION_REGEX
'"
>
&2
exit
1
exit
1
...
@@ -32,6 +32,7 @@ VERSION_REGEX="v([0-9]+).([0-9]+(.[0-9]+)?)"
...
@@ -32,6 +32,7 @@ VERSION_REGEX="v([0-9]+).([0-9]+(.[0-9]+)?)"
VERSION_MAJOR
=
"
${
BASH_REMATCH
[1]
}
"
VERSION_MAJOR
=
"
${
BASH_REMATCH
[1]
}
"
VERSION_MINOR
=
"
${
BASH_REMATCH
[2]
}
"
VERSION_MINOR
=
"
${
BASH_REMATCH
[2]
}
"
VERSION_PATCH
=
"
${
BASH_REMATCH
[3]
}
"
if
!
git diff-index
--quiet
--cached
HEAD
;
then
if
!
git diff-index
--quiet
--cached
HEAD
;
then
echo
"!!! You must not have any changes in your index when running this command"
echo
"!!! You must not have any changes in your index when running this command"
...
@@ -43,6 +44,16 @@ if ! git diff-files --quiet pkg/version/base.go; then
...
@@ -43,6 +44,16 @@ if ! git diff-files --quiet pkg/version/base.go; then
exit
1
exit
1
fi
fi
release_branch
=
"release-
${
VERSION_MAJOR
}
.
${
VERSION_MINOR
}
"
current_branch
=
$(
git rev-parse
--abbrev-ref
HEAD
)
if
[[
"
${
VERSION_PATCH
}
"
!=
"0"
]]
;
then
if
[[
${
current_branch
}
!=
"
${
release_branch
}
"
]]
;
then
echo
"!!! You are trying to tag to an existing minor release but are not on the release branch:
${
release_branch
}
"
exit
1
fi
fi
SED
=
sed
SED
=
sed
if
which gsed &>/dev/null
;
then
if
which gsed &>/dev/null
;
then
SED
=
gsed
SED
=
gsed
...
@@ -53,9 +64,10 @@ fi
...
@@ -53,9 +64,10 @@ fi
VERSION_FILE
=
"
${
KUBE_ROOT
}
/pkg/version/base.go"
VERSION_FILE
=
"
${
KUBE_ROOT
}
/pkg/version/base.go"
GIT_MINOR
=
"
${
VERSION_MINOR
}
.
${
VERSION_PATCH
}
"
echo
"+++ Updating to
${
NEW_VERSION
}
"
echo
"+++ Updating to
${
NEW_VERSION
}
"
"
$SED
"
-r
-i
-e
"s/gitMajor
\s
+string =
\"
[^
\"
]*
\"
/gitMajor string =
\"
$
VERSION_MAJOR
\"
/"
"
${
VERSION_FILE
}
"
"
$SED
"
-r
-i
-e
"s/gitMajor
\s
+string =
\"
[^
\"
]*
\"
/gitMajor string =
\"
$
{
VERSION_MAJOR
}
\"
/"
"
${
VERSION_FILE
}
"
"
$SED
"
-r
-i
-e
"s/gitMinor
\s
+string =
\"
[^
\"
]*
\"
/gitMinor string =
\"
$
VERSION_MINOR
\"
/"
"
${
VERSION_FILE
}
"
"
$SED
"
-r
-i
-e
"s/gitMinor
\s
+string =
\"
[^
\"
]*
\"
/gitMinor string =
\"
$
{
GIT_MINOR
}
\"
/"
"
${
VERSION_FILE
}
"
"
$SED
"
-r
-i
-e
"s/gitVersion
\s
+string =
\"
[^
\"
]*
\"
/gitVersion string =
\"
$NEW_VERSION
\"
/"
"
${
VERSION_FILE
}
"
"
$SED
"
-r
-i
-e
"s/gitVersion
\s
+string =
\"
[^
\"
]*
\"
/gitVersion string =
\"
$NEW_VERSION
\"
/"
"
${
VERSION_FILE
}
"
gofmt
-s
-w
"
${
VERSION_FILE
}
"
gofmt
-s
-w
"
${
VERSION_FILE
}
"
...
@@ -67,11 +79,30 @@ echo "+++ Tagging version"
...
@@ -67,11 +79,30 @@ echo "+++ Tagging version"
git tag
-a
-m
"Kubernetes version
$NEW_VERSION
"
"
${
NEW_VERSION
}
"
git tag
-a
-m
"Kubernetes version
$NEW_VERSION
"
"
${
NEW_VERSION
}
"
echo
"+++ Updating to
${
NEW_VERSION
}
-dev"
echo
"+++ Updating to
${
NEW_VERSION
}
-dev"
"
$SED
"
-r
-i
-e
"s/gitMajor
\s
+string =
\"
[^
\"
]*
\"
/gitMajor string =
\"
$
VERSION_MAJOR
\"
/"
"
${
VERSION_FILE
}
"
"
$SED
"
-r
-i
-e
"s/gitMajor
\s
+string =
\"
[^
\"
]*
\"
/gitMajor string =
\"
$
{
VERSION_MAJOR
}
\"
/"
"
${
VERSION_FILE
}
"
"
$SED
"
-r
-i
-e
"s/gitMinor
\s
+string =
\"
[^
\"
]*
\"
/gitMinor string =
\"
$
VERSION_MINOR
\+\"
/"
"
${
VERSION_FILE
}
"
"
$SED
"
-r
-i
-e
"s/gitMinor
\s
+string =
\"
[^
\"
]*
\"
/gitMinor string =
\"
$
{
GIT_MINOR
}
\+\"
/"
"
${
VERSION_FILE
}
"
"
$SED
"
-r
-i
-e
"s/gitVersion
\s
+string =
\"
[^
\"
]*
\"
/gitVersion string =
\"
$NEW_VERSION
-dev
\"
/"
"
${
VERSION_FILE
}
"
"
$SED
"
-r
-i
-e
"s/gitVersion
\s
+string =
\"
[^
\"
]*
\"
/gitVersion string =
\"
$NEW_VERSION
-dev
\"
/"
"
${
VERSION_FILE
}
"
gofmt
-s
-w
"
${
VERSION_FILE
}
"
gofmt
-s
-w
"
${
VERSION_FILE
}
"
echo
"+++ Committing version change"
echo
"+++ Committing version change"
git add
"
${
VERSION_FILE
}
"
git add
"
${
VERSION_FILE
}
"
git commit
-m
"Kubernetes version
${
NEW_VERSION
}
-dev"
git commit
-m
"Kubernetes version
${
NEW_VERSION
}
-dev"
if
[[
"
${
VERSION_PATCH
}
"
==
"0"
]]
;
then
echo
"+++ Creating release branch"
git branch
"
${
release_branch
}
"
fi
echo
"Success you must now:"
echo
""
echo
"- Push the tag:"
echo
" git push git@github.com:GoogleCloudPlatform/kubernetes.git v
${
VERSION_MAJOR
}
.
${
VERSION_MINOR
}
.
${
VERSION_PATCH
}
"
if
[[
"
${
VERSION_PATCH
}
"
==
"0"
]]
;
then
echo
"- Submit branch:
${
current_branch
}
as a PR to master"
echo
"- Merge that PR"
echo
"- Push the new release branch"
echo
" git push git@github.com:GoogleCloudPlatform/kubernetes.git
${
release_branch
}
"
else
echo
"- Submit branch:
${
current_branch
}
as a PR to
${
release_branch
}
"
echo
"- Merge that PR"
fi
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