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
fbe6e8c5
Commit
fbe6e8c5
authored
Jan 15, 2019
by
据说甜蜜呢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构自动扩容脚本
parent
4d129992
Pipeline
#4367
passed with stage
in 21 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
26 deletions
+14
-26
devops/PipeLines/AutoScaling.sh
+14
-26
No files found.
devops/PipeLines/AutoScaling.sh
View file @
fbe6e8c5
#!/bin/bash
#!/bin/bash
set
-e
set
-e
IFS
=
$'
\n\n
'
# Import external functions
# Import external functions
chmod +x ./devops/PipeLines/Functions.deploy.sh
chmod +x ./devops/PipeLines/Functions.deploy.sh
source
./devops/PipeLines/Functions.deploy.sh
source
./devops/PipeLines/Functions.deploy.sh
# global variabl
e
GetNameSpace namespac
e
RollEnvironmentOf Environment
GetReplicas replicas
GetAppName appName
if
[
"
${
AllPublishable
}
"
==
"1"
]
;
echo
"[
${
Environment
}
]Auto scaling for
${
appName
}
starting..."
GetCiCdSettings allPublishable noPublishable
if
[
"
${
noPublishable
}
"
==
"1"
]
;
then
then
echo
""
echo
"Tips: No services need to be cded."
else
GetNameSpace namespace
GetReplicas replicas
for
servicePrefix
in
`
ls
./src/Services|xargs
-d
'/'
`
for
servicePrefix
in
`
ls
./src/Services|xargs
-d
'/'
`
do
do
IsPublishableOf
${
servicePrefix
}
isPublishable
echo
"All micro-services will be scaled, replicas: [
${
replicas
}
]."
GetServiceName
${
servicePrefix
}
serviceName
GetServiceName
${
servicePrefix
}
serviceName
AutoScaling
${
namespace
}
${
serviceName
}
${
replicas
}
done
else
for
servicePrefix
in
`
ls
./src/Services|xargs
-d
'/'
`
do
# Notes: Hard release[manual control], will not analyz changes.
DynamicVariableValueOf
"
${
servicePrefix
}
"
"Publishable"
isPublishable
if
[
"
${
isPublishable
}
"
==
"1"
]
;
if
[
"
${
isPublishable
}
"
==
"1"
]
;
then
then
echo
""
echo
"
Tips:
${
servicePrefix
}
will be scaled, replicas: [
${
replicas
}
].
"
echo
"Tips:
${
serviceName
}
begin scaling, replicas: [
${
replicas
}
]!!!"
GetServiceName
${
servicePrefix
}
serviceName
AutoScaling
${
namespace
}
${
serviceName
}
${
replicas
}
AutoScaling
${
namespace
}
${
serviceName
}
${
replicas
}
else
echo
""
echo
"Tips:
${
serviceName
}
will not be scaled!!!"
fi
fi
done
done
fi
fi
\ No newline at end of file
echo
""
echo
"[
${
Environment
}
]Auto scaling for
${
appName
}
has been successful."
\ 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