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
e4b613b5
Commit
e4b613b5
authored
Apr 01, 2015
by
Zach Loafman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Infer the URL from the existing git setup. (I don't push via ssh)
Also document using the recursive/ours merge strategy, because it's almost certainly what we want to do in this case.
parent
0cf3590c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
mark-new-version.sh
build/mark-new-version.sh
+16
-10
No files found.
build/mark-new-version.sh
View file @
e4b613b5
...
@@ -24,6 +24,12 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
...
@@ -24,6 +24,12 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
NEW_VERSION
=
${
1
-
}
NEW_VERSION
=
${
1
-
}
fetch_url
=
$(
git remote
-v
|
grep
GoogleCloudPlatform/kubernetes.git |
grep
fetch |
awk
'{ print $2 }'
)
if
!
push_url
=
$(
git remote
-v
|
grep
GoogleCloudPlatform/kubernetes.git |
grep
push |
awk
'{ print $2 }'
)
;
then
push_url
=
"https://github.com/GoogleCloudPlatform/kubernetes.git"
fi
fetch_remote
=
$(
git remote
-v
|
grep
GoogleCloudPlatform/kubernetes.git |
grep
fetch |
awk
'{ print $1 }'
)
VERSION_REGEX
=
"^v(0|[1-9][0-9]*)
\\
.(0|[1-9][0-9]*)
\\
.(0|[1-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
...
@@ -51,19 +57,19 @@ if [[ "${VERSION_PATCH}" != "0" ]]; then
...
@@ -51,19 +57,19 @@ if [[ "${VERSION_PATCH}" != "0" ]]; then
# sorry, no going back in time, pull latest from upstream
# sorry, no going back in time, pull latest from upstream
git remote update
>
/dev/null 2>&1
git remote update
>
/dev/null 2>&1
if
git ls-remote
--tags
--exit-code
git@github.com:GoogleCloudPlatform/kubernetes.git
refs/tags/
${
NEW_VERSION
}
>
/dev/null
;
then
if
git ls-remote
--tags
--exit-code
${
fetch_url
}
refs/tags/
${
NEW_VERSION
}
>
/dev/null
;
then
echo
"!!! You are trying to tag
${
NEW_VERSION
}
but it already exists. Stop it!"
echo
"!!! You are trying to tag
${
NEW_VERSION
}
but it already exists. Stop it!"
exit
1
exit
1
fi
fi
last_version
=
"v
${
VERSION_MAJOR
}
.
${
VERSION_MINOR
}
.
$((
VERSION_PATCH-1
))
"
last_version
=
"v
${
VERSION_MAJOR
}
.
${
VERSION_MINOR
}
.
$((
VERSION_PATCH-1
))
"
if
!
git ls-remote
--tags
--exit-code
git@github.com:GoogleCloudPlatform/kubernetes.git
refs/tags/
${
last_version
}
>
/dev/null
;
then
if
!
git ls-remote
--tags
--exit-code
${
fetch_url
}
refs/tags/
${
last_version
}
>
/dev/null
;
then
echo
"!!! You are trying to tag
${
NEW_VERSION
}
but
${
last_version
}
doesn't even exist!"
echo
"!!! You are trying to tag
${
NEW_VERSION
}
but
${
last_version
}
doesn't even exist!"
exit
1
exit
1
fi
fi
# this is rather magic. This checks that HEAD is a descendant of the github branch release-x.y
# this is rather magic. This checks that HEAD is a descendant of the github branch release-x.y
branches
=
$(
git branch
--contains
$(
git ls-remote
--heads
git@github.com:GoogleCloudPlatform/kubernetes.git
refs/heads/
${
release_branch
}
|
cut
-f1
)
${
current_branch
})
branches
=
$(
git branch
--contains
$(
git ls-remote
--heads
${
fetch_url
}
refs/heads/
${
release_branch
}
|
cut
-f1
)
${
current_branch
})
if
[[
$?
-ne
0
]]
;
then
if
[[
$?
-ne
0
]]
;
then
echo
"!!! git failed, I dunno...."
echo
"!!! git failed, I dunno...."
exit
1
exit
1
...
@@ -113,7 +119,7 @@ echo ""
...
@@ -113,7 +119,7 @@ echo ""
echo
"Success you must now:"
echo
"Success you must now:"
echo
""
echo
""
echo
"- Push the tag:"
echo
"- Push the tag:"
echo
" git push
git@github.com:GoogleCloudPlatform/kubernetes.git
v
${
VERSION_MAJOR
}
.
${
VERSION_MINOR
}
.
${
VERSION_PATCH
}
"
echo
" git push
${
push_url
}
v
${
VERSION_MAJOR
}
.
${
VERSION_MINOR
}
.
${
VERSION_PATCH
}
"
echo
" - Please note you are pushing the tag live BEFORE your PRs."
echo
" - Please note you are pushing the tag live BEFORE your PRs."
echo
" You need this so the builds pick up the right tag info."
echo
" You need this so the builds pick up the right tag info."
echo
" If something goes wrong further down please fix the tag!"
echo
" If something goes wrong further down please fix the tag!"
...
@@ -125,7 +131,7 @@ if [[ "${VERSION_PATCH}" == "0" ]]; then
...
@@ -125,7 +131,7 @@ if [[ "${VERSION_PATCH}" == "0" ]]; then
echo
"- Send branch:
${
current_branch
}
as a PR to master"
echo
"- Send branch:
${
current_branch
}
as a PR to master"
echo
"- Get someone to review and merge that PR"
echo
"- Get someone to review and merge that PR"
echo
"- Push the new release branch"
echo
"- Push the new release branch"
echo
" git push
git@github.com:GoogleCloudPlatform/kubernetes.git
${
current_branch
}
:
${
release_branch
}
"
echo
" git push
${
push_url
}
${
current_branch
}
:
${
release_branch
}
"
else
else
echo
"- Send branch:
${
current_branch
}
as a PR to
${
release_branch
}
"
echo
"- Send branch:
${
current_branch
}
as a PR to
${
release_branch
}
"
echo
"- Get someone to review and merge that PR"
echo
"- Get someone to review and merge that PR"
...
@@ -142,13 +148,13 @@ else
...
@@ -142,13 +148,13 @@ else
echo
"pushed as an ancestor of master, even though the tag is on on a release"
echo
"pushed as an ancestor of master, even though the tag is on on a release"
echo
"branch. The tag will thus be found by tools like git describe"
echo
"branch. The tag will thus be found by tools like git describe"
echo
""
echo
""
echo
"- Update so you see that merge in
origin
"
echo
"- Update so you see that merge in
${
fetch_remote
}
"
echo
" git remote update"
echo
" git remote update"
echo
"- Create and check out a new branch based on master"
echo
"- Create and check out a new branch based on master"
echo
" git checkout -b merge-
${
release_branch
}
-to-master
origin
/master"
echo
" git checkout -b merge-
${
release_branch
}
-to-master
${
fetch_remote
}
/master"
echo
"- Merge the
${
release_branch
}
into your merge-
${
release_branch
}
-to-master branch"
echo
"- Merge the
${
release_branch
}
into your merge-
${
release_branch
}
-to-master branch
:
"
echo
" git merge
${
release_branch
}
"
echo
" git merge
-s recursive -X ours
${
fetch_remote
}
/
${
release_branch
}
"
echo
" - It's possible you have merge conflicts."
echo
" - It's possible you have merge conflicts
that weren't resolved by the merge strategy
."
echo
" - You will almost always want to take what is in HEAD"
echo
" - You will almost always want to take what is in HEAD"
echo
" - If you are not SURE how to solve these correctly, ask for help."
echo
" - If you are not SURE how to solve these correctly, ask for help."
echo
" - It is possible to break other people's work if you didn't understand why"
echo
" - It is possible to break other people's work if you didn't understand why"
...
...
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