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
c7c7d6c0
Commit
c7c7d6c0
authored
Apr 01, 2016
by
David McMahon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix valid CI version regex in kube::release::parse_and_validate_release_version().
parent
bf07a6f5
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 @
c7c7d6c0
...
...
@@ -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