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
122842dd
Commit
122842dd
authored
Jan 11, 2019
by
据说甜蜜呢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构
parent
2ab2aead
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
33 deletions
+12
-33
devops/PipeLines/Updating/004_CD.sh
+12
-33
No files found.
devops/PipeLines/Updating/004_CD.sh
View file @
122842dd
...
@@ -7,7 +7,7 @@ sh ./devops/PipeLines/functions.sh
...
@@ -7,7 +7,7 @@ sh ./devops/PipeLines/functions.sh
GetAppName appName
GetAppName appName
echo
"Continuous deployment
of
${
Environment
}
branch
for
${
appName
}
starting..."
echo
"Continuous deployment
[
${
Environment
}
]
for
${
appName
}
starting..."
GetCiCdSettings allPublishable noPublishable
GetCiCdSettings allPublishable noPublishable
...
@@ -16,45 +16,24 @@ then
...
@@ -16,45 +16,24 @@ then
echo
""
echo
""
echo
"Tips: No services need to be cded."
echo
"Tips: No services need to be cded."
else
else
echo
"Please check the version of each microservice carefully !!!"
echo
""
GetVersion version
GetVersion version
GetNameSpace namespace
GetImageRegistrySettings registryHost registryUserName
GetImageRegistrySettings registryHost registryUserName
function
CD
()
for
servicePrefix
in
`
ls
./src/Services|xargs
-d
'/'
`
{
do
declare
publishable
=
$1
IsPublishableOf
${
servicePrefix
}
isPublishable
declare
appName
=
$2
GetServiceName
${
servicePrefix
}
serviceName
declare
imageName
=
$3
if
[
"
${
isPublishable
}
"
==
"1"
]
;
echo
""
if
[
"
${
publishable
}
"
==
"1"
]
;
then
then
kubectl
-n
${
namespace
}
set
image deployments/
${
appName
}
"
${
appName
}
=
${
registryHost
}
/
${
registryUserName
}
/
${
imageName
}
:
${
version
}
"
;
echo
""
if
[
"
${
Environment
}
"
==
"Staging"
]
;
then
echo
"Tips:
${
serviceName
}
begin deployment to K8S!!!"
kubectl
-n
${
namespace
}
scale deploy
${
appName
}
--replicas
=
0
;
CD
${
registryHost
}
${
registryUserName
}
${
serviceName
}
${
version
}
kubectl
-n
${
namespace
}
scale deploy
${
appName
}
--replicas
=
1
;
fi
echo
"deployment of
${
Environment
}
branch for
${
appName
}
:
${
version
}
has been successful."
else
else
echo
"Tips:
${
Environment
}
branch for
${
appName
}
:
${
version
}
will not be cded!!!"
echo
""
echo
"Tips:
${
serviceName
}
will not be deploymented to K8S!!!"
fi
fi
}
declare
services
=
$(
ls
-l
src/services | awk
'NR>1'
)
declare
servicePrefix
=
""
declare
serviceName
=
""
declare
isPublishable
=
"0"
for
service
in
${
services
}
do
servicePrefix
=(
$(
echo
${
service
}
| awk
'{print $9}'
)
)
isPublishable
=(
$(
grep
-oP
"(?<=
${
servicePrefix
}
Publishable>)[^<]+"
"/tmp/cicd.props"
)
)
GetServiceName
"
${
servicePrefix
}
"
serviceName
CD
${
apiPublishable
}
"
${
serviceName
}
"
"
${
serviceName
}
"
done
done
fi
fi
echo
""
echo
""
echo
"Continuous deployment
of
${
Environment
}
branch
for
${
appName
}
has been successful."
echo
"Continuous deployment
[
${
Environment
}
]
for
${
appName
}
has been successful."
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