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
41a77dde
Commit
41a77dde
authored
Jan 15, 2019
by
据说甜蜜呢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构回滚脚本
parent
12ee26f0
Pipeline
#4373
passed with stage
in 23 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
27 deletions
+15
-27
devops/PipeLines/RollBack.sh
+15
-27
No files found.
devops/PipeLines/RollBack.sh
View file @
41a77dde
#!/bin/bash
set
-e
IFS
=
$'
\n\n
'
# Import external functions
chmod +x ./devops/PipeLines/Functions.deploy.sh
source
./devops/PipeLines/Functions.deploy.sh
# global variable
RollEnvironmentOf Environment
GetRollBackVersion version
GetNameSpace namespace
GetRegistryHost registryHost
GetImageUserName registryUserName
GetAppName appName
echo
"Continuous deployment[
${
Environment
}
] for
${
appName
}
starting..."
GetCiCdSettings allPublishable noPublishable
if
[
"
${
noPublishable
}
"
==
"1"
]
;
if
[
"
${
AllPublishable
}
"
==
"1"
]
;
then
echo
""
echo
"Tips: No services need to be cded."
else
GetRollBackVersion version
GetNameSpace namespace
GetRegistryHost registryHost
GetImageUserName registryUserName
echo
"Tips: All micro-services will be roll-backed, version:
${
version
}
."
for
servicePrefix
in
`
ls
./src/Services|xargs
-d
'/'
`
do
IsPublishableOf
${
servicePrefix
}
isPublishable
GetServiceName
${
servicePrefix
}
serviceName
CD
${
registryHost
}
${
registryUserName
}
${
serviceName
}
${
version
}
${
namespace
}
done
else
for
servicePrefix
in
`
ls
./src/Services|xargs
-d
'/'
`
do
DynamicVariableValueOf
"
${
servicePrefix
}
"
"Publishable"
isPublishable
if
[
"
${
isPublishable
}
"
==
"1"
]
;
then
echo
""
echo
"Tips:
${
serviceName
}
begin deployment to K8S!!!"
echo
"
Tips:
${
servicePrefix
}
will be roll-backed, version:
${
version
}
.
"
GetServiceName
${
servicePrefix
}
serviceName
CD
${
registryHost
}
${
registryUserName
}
${
serviceName
}
${
version
}
${
namespace
}
else
echo
""
echo
"Tips:
${
serviceName
}
will not be deploymented to K8S!!!"
fi
done
fi
\ No newline at end of file
echo
""
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