Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
microservice-autodevopspipelines
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李春生
microservice-autodevopspipelines
Commits
1809f62e
Commit
1809f62e
authored
6 years ago
by
据说甜蜜呢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加方法
parent
947090aa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
devops/PipeLines/Functions.common.sh
+10
-0
devops/PipeLines/Functions.core.sh
+25
-0
No files found.
devops/PipeLines/Functions.common.sh
View file @
1809f62e
...
@@ -32,3 +32,12 @@ function FirstCharUpperCase()
...
@@ -32,3 +32,12 @@ function FirstCharUpperCase()
declare
output
=(
$(
echo
${
input
}
| sed
-e
"s/
\b\(
.
\)
/
\u\1
/g"
)
)
declare
output
=(
$(
echo
${
input
}
| sed
-e
"s/
\b\(
.
\)
/
\u\1
/g"
)
)
eval
$2
=
${
output
}
eval
$2
=
${
output
}
}
}
function
Substr
()
{
declare
input
=
$1
declare
start
=
$2
declare
length
=
$3
declare
output
=
${
input
:start:length
}
eval
$4
=
${
output
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
devops/PipeLines/Functions.core.sh
View file @
1809f62e
...
@@ -82,6 +82,31 @@ function GetVersion()
...
@@ -82,6 +82,31 @@ function GetVersion()
eval
$1
=
"
${
major
}
.
${
minor
}
.
${
patch
}
"
eval
$1
=
"
${
major
}
.
${
minor
}
.
${
patch
}
"
}
}
function
GetNumericVersion
()
{
declare
major
=(
$(
grep
-oP
'(?<=Major>)[^<]+'
"./devops/version.props"
)
)
declare
minor
=(
$(
grep
-oP
'(?<=Minor>)[^<]+'
"./devops/version.props"
)
)
declare
patch
=(
$(
grep
-oP
'(?<=Patch>)[^<]+'
"./devops/version.props"
)
)
eval
$1
=
${
major
}${
minor
}${
patch
}
}
function
GetRollBackVersion
()
{
GetNumericVersion currentVersion
declare
step
=(
$(
grep
-oP
'(?<=RollBackStep>)[^<]+'
"devops/deploy.props"
)
)
declare
rollbackVersion
=
`
expr
$currentVersion
-
$step
`
declare
versionStr
=
""
if
[
"
$rollbackVersion
"
-lt
"100"
]
then
versionStr
=
"0.
${
rollbackVersion
:0:1
}
.
${
rollbackVersion
:1:1
}
"
else
versionStr
=
"
${
rollbackVersion
:0:1
}
.
${
rollbackVersion
:1:1
}
.
${
rollbackVersion
:2:1
}
"
fi
eval
$1
=
${
versionStr
}
}
function
GetImageRegistrySettings
()
function
GetImageRegistrySettings
()
{
{
declare
host
=(
$(
grep
-oP
'(?<=ImageRegistryHost>)[^<]+'
"devops/deploy.props"
)
)
declare
host
=(
$(
grep
-oP
'(?<=ImageRegistryHost>)[^<]+'
"devops/deploy.props"
)
)
...
...
This diff is collapsed.
Click to expand it.
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