I have the following code in my deployment:
#{each SecureVariable in Global_SecureVariable}
value="#{SecureVariable.Value}"
value="${value%"}"
value="${value#"}"
if [ -n “$value” ] && [ “$value” != “” ]; then
if grep -q ‘^#{SecureVariable.Variable}’ $filename; then
sed -i ‘/^#{SecureVariable.Variable}/c#{SecureVariable.Variable}=#{SecureVariable.Value}’ $filename
else
tee -a $filename <<< “#{SecureVariable.Variable}=#{SecureVariable.Value}”
fi
fi
#{/each}
I have the following variables store in a library set:
Global_SecureVariable[host].Variable = securehub.host
Global_SecureVariable[host].Value = xxxxyyyy
Global_SecureVariable[password].Variable = securehub.password
Global_SecureVariable[password].Value = zzzddd
Global_SecureVariable[username].Variable = user
Global_SecureVariable[username].Value = afrearo35
All the Variables with .Value has scope Environment to “INT”
When run the script it return the following to the file:
securehub.host=xxxxyyyy
securehub.password=zzzddd
securehub.username=#{SecureVariable.Value}
I ran another test where I removed the scope from Global_SecureVariable[username].Value and this work as expected.
I ran another test where I add a second Global_SecureVariable[username].Value with no scope. This too ran OK in my INT environment. I’ve used this as a work around.
Can you please review the issue.
btw I’m runnin 2018-06-15