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
af1803bf
Commit
af1803bf
authored
Apr 12, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #23763 from david-mcmahon/build-regex
Automatic merge from submit-queue Fix valid CI version regex in parse_and_validate_release_version(). Ref: #23759 cc @ihmccreery
parents
31de6221
c7c7d6c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
common.sh
build/common.sh
+4
-4
No files found.
build/common.sh
View file @
af1803bf
...
...
@@ -423,17 +423,17 @@ function kube::release::parse_and_validate_release_version() {
# version
# Returns:
# If version is a valid ci version
# Sets: (e.g. for '1.2.3-alpha.4.56+abcd
789-dirty
')
# Sets: (e.g. for '1.2.3-alpha.4.56+abcd
ef12345678
')
# VERSION_MAJOR (e.g. '1')
# VERSION_MINOR (e.g. '2')
# VERSION_PATCH (e.g. '3')
# VERSION_PRERELEASE (e.g. 'alpha')
# VERSION_PRERELEASE_REV (e.g. '4')
# VERSION_BUILD_INFO (e.g. '.56+abcd
789-dirty
')
# VERSION_BUILD_INFO (e.g. '.56+abcd
ef12345678
')
# VERSION_COMMITS (e.g. '56')
function
kube::release::parse_and_validate_ci_version
()
{
# Accept things like "v1.2.3-alpha.4.56+abcd
789-dirty" or "v1.2.3-beta.4.56
"
local
-r
version_regex
=
"^v(0|[1-9][0-9]*)
\\
.(0|[1-9][0-9]*)
\\
.(0|[1-9][0-9]*)-(beta|alpha)
\\
.(0|[1-9][0-9]*)(
\\
.(0|[1-9][0-9]*)
\\
+[
-0-9a-z]*
)?$"
# Accept things like "v1.2.3-alpha.4.56+abcd
ef12345678" or "v1.2.3-beta.4
"
local
-r
version_regex
=
"^v(0|[1-9][0-9]*)
\\
.(0|[1-9][0-9]*)
\\
.(0|[1-9][0-9]*)-(beta|alpha)
\\
.(0|[1-9][0-9]*)(
\\
.(0|[1-9][0-9]*)
\\
+[
0-9a-f]{7,40}
)?$"
local
-r
version
=
"
${
1
-
}
"
[[
"
${
version
}
"
=
~
${
version_regex
}
]]
||
{
kube::log::error
"Invalid ci version: '
${
version
}
', must match regex
${
version_regex
}
"
...
...
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