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
15dc6525
Commit
15dc6525
authored
Jan 09, 2019
by
据说甜蜜呢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构
parent
3217ff56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
19 deletions
+18
-19
devops/PipeLines/Creation/003_ReleaseMajor.sh
+18
-19
No files found.
devops/PipeLines/Creation/003_ReleaseMajor.sh
View file @
15dc6525
...
...
@@ -2,40 +2,39 @@
set
-e
IFS
=
$'
\n\n
'
declare
appName
=(
$(
grep
-oP
'(?<=AppName>)[^<]+'
"devops/app.props"
)
)
# Import external functions
chmod +x ./devops/PipeLines/Functions.core.sh
source
./devops/PipeLines/Functions.core.sh
echo
"Release for
${
appName
}
starting, dynamicly creating k8s environment..."
GetAppName appName
declare
major
=(
$(
grep
-oP
'(?<=Major>)[^<]+'
"devops/version.props"
)
)
declare
minor
=(
$(
grep
-oP
'(?<=Minor>)[^<]+'
"devops/version.props"
)
)
declare
patch
=(
$(
grep
-oP
'(?<=Patch>)[^<]+'
"devops/version.props"
)
)
declare
namespace
=(
$(
grep
-oP
'(?<=Namespace>)[^<]+'
"devops/app.props"
)
)
echo
"starting release for
${
appName
}
, it will dynamicly create k8s environment..."
declare
version
=
${
major
}
.
${
minor
}
.
${
patch
}
declare
namespaceOfK8s
=
$(
echo
"
${
namespace
}
-v
${
major
}
"
| tr
'A-Z'
'a-z'
)
GetMajor major
GetVersion version
GetNameSpace namespace
declare
releaseName
=
"
${
appName
}
-v
${
major
}
"
echo
""
echo
"Please check the image version of each microservice carefully !!!"
echo
"kubernetes's namespace:
${
namespaceOfK8s
}
"
declare
services
=
$(
ls
-l
src/services | awk
'NR>1'
)
declare
servicePrefix
=
""
for
service
in
${
services
}
echo
"kubernetes's namespace:
${
namespace
}
"
for
servicePrefix
in
`
ls
./src/Services|xargs
-d
'/'
`
do
servicePrefix
=(
$(
echo
${
service
}
| awk
'{print $9}'
)
)
echo
"
${
service
Prefix
}
:
${
version
}
"
GetServiceName
${
servicePrefix
}
serviceName
echo
"
${
service
Name
}
:
${
version
}
"
done
echo
""
declare
replicas
=(
$(
grep
-oP
'(?<=Replicas>)[^<]+'
"devops/app.props"
)
)
GetReplicas replicas
ToLower
${
Environment
}
environment
helm install /root/AutoDevOpsPipeLinesCharts
\
--name
=
${
releaseName
}
\
--set
environment.upper
=
${
Environment
}
\
--set
environment.lower
=
$
(
echo
${
Environment
}
| tr
'A-Z'
'a-z'
)
\
--set
namespace
=
${
namespace
OfK8s
}
\
--set
environment.lower
=
$
{
environment
}
\
--set
namespace
=
${
namespace
}
\
--set
image.version
=
${
version
}
\
--set
replicas
=
${
replicas
}
echo
""
echo
"Dynamicly creating k8s environment Successfully !!!"
\ No newline at end of file
echo
"k8s environment Created Successfully !!!"
\ 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