Commit acac5383 by 李二毛

Merge branch 'development' into 'staging'

添加方法DynamicVariableValueOf

See merge request liermao/microservice-autodevopspipelines!68
parents f70ee327 246f7514
Pipeline #4238 passed with stages
in 19 seconds
...@@ -17,3 +17,11 @@ function Replace() ...@@ -17,3 +17,11 @@ function Replace()
declare output=${input//${sourceExpr}/${targetExpr}} declare output=${input//${sourceExpr}/${targetExpr}}
eval $4=${output} eval $4=${output}
} }
function DynamicVariableValueOf()
{
declare prefix=$1
declare suffix=$2
eval "output=\$$prefix$suffix"
eval $3=${output}
}
\ No newline at end of file
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
set -e set -e
IFS=$'\n\n' IFS=$'\n\n'
# Import external functions
chmod +x ./devops/PipeLines/Functions.common.sh
source ./devops/PipeLines/Functions.common.sh
function AddHeadConfig() function AddHeadConfig()
{ {
# sync config for later retries, not affected by cross-job. # sync config for later retries, not affected by cross-job.
...@@ -62,7 +66,7 @@ else ...@@ -62,7 +66,7 @@ else
for servicePrefix in `ls ./src/Services|xargs -d '/'` for servicePrefix in `ls ./src/Services|xargs -d '/'`
do do
# Notes: Hard release[manual control], will not analyz changes. # Notes: Hard release[manual control], will not analyz changes.
isPublishable=$(eval echo ${servicePrefix}Publishable) DynamicVariableValueOf "${servicePrefix}" "Publishable" isPublishable
if [ "${isPublishable}" == "1" ]; if [ "${isPublishable}" == "1" ];
then then
AddConfig "${servicePrefix}" "${isPublishable}" AddConfig "${servicePrefix}" "${isPublishable}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment