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
77c4fc89
Commit
77c4fc89
authored
Jan 09, 2019
by
据说甜蜜呢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加文件
parent
40358c5b
Pipeline
#4136
passed with stage
in 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
0 deletions
+92
-0
devops/PipeLines/Functions.core.sh
+92
-0
No files found.
devops/PipeLines/Functions.core.sh
0 → 100644
View file @
77c4fc89
#!/bin/bash
set
-e
function
ToLower
()
{
declare
input
=
$1
declare
output
=(
$(
echo
"
${
input
}
"
| tr
'A-Z'
'a-z'
)
)
eval
$2
=
${
output
}
}
function
GetServices
()
{
# eval $1=`ls ./src/Services|xargs -d '/'`
}
function
GetServiceCsProjFile
()
{
declare
prefix
=
${
1
}
declare
name
=
${
2
}
declare
csprojFile
=
"./src/Services/
${
prefix
}
/
${
name
}
/
${
name
}
.csproj"
eval
$3
=
"
${
csprojFile
}
"
}
function
GetServiceName
()
{
declare
prefix
=
${
1
}
declare
name
=(
$(
ls
./src/Services/
${
prefix
}
|head
-n
1|xargs
-d
'/'
echo
)
)
eval
$2
=
"
${
name
}
"
}
function
GetAppName
()
{
declare
name
=(
$(
grep
-oP
'(?<=AppName>)[^<]+'
"./devops/app.props"
)
)
eval
$1
=
"
${
name
}
"
}
function
GetSolutionName
()
{
declare
name
=(
$(
grep
-oP
'(?<=SolutionName>)[^<]+'
"./devops/app.props"
)
)
eval
$1
=
"
${
name
}
"
}
function
GetImageUserName
()
{
declare
name
=(
$(
grep
-oP
'(?<=ImageUserName>)[^<]+'
"devops/deploy.props"
)
)
eval
$1
=
"
${
name
}
"
}
function
GetCiCdSettings
()
{
declare
all
=(
$(
grep
-oP
'(?<=AllPublishable>)[^<]+'
"/tmp/cicd.props"
)
)
declare
no
=(
$(
grep
-oP
'(?<=NoPublishable>)[^<]+'
"/tmp/cicd.props"
)
)
eval
$1
=
${
all
}
eval
$2
=
${
no
}
}
function
GetMajor
()
{
declare
m
=(
$(
grep
-oP
'(?<=Major>)[^<]+'
"./devops/version.props"
)
)
eval
$1
=
${
m
}
}
function
GetVersion
()
{
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
GetImageRegistrySettings
()
{
declare
host
=(
$(
grep
-oP
'(?<=ImageRegistryHost>)[^<]+'
"devops/deploy.props"
)
)
declare
username
=(
$(
grep
-oP
'(?<=ImageUserName>)[^<]+'
"devops/deploy.props"
)
)
eval
$1
=
${
host
}
eval
$2
=
${
username
}
}
function
GetAccessTokenOf
()
{
declare
token
=(
$(
grep
-oP
"(?<=
${
Environment
}
AccessToken>)[^<]+"
"devops/deploy.props"
)
)
eval
$1
=
"
${
token
}
"
}
function
IsPublishableOf
()
{
declare
prefix
=
$0
declare
isP
=(
$(
grep
-oP
"(?<=
${
prefix
}
Publishable>)[^<]+"
"/tmp/cicd.props"
)
)
eval
$1
=
isP
}
\ No newline at end of file
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