Hi I need help to pass variables from UrbanCode processes to deploy.sh

790 Views Asked by At

I'm new to UrbanCode Deploy, I ran in to an issue, so I have the urbanCode processor where I have added component properties as username and password. I call that to script inside process and tested printing them and it works. so now I have to pass those username and password variable to deploy.sh. I have the scripts that accepts username and password and does stuff. I tried to pass in those variable as parameters to deploy.sh file.

#here is an example 
 var1=${p:environment/username}
 var2=${p:environment/pass}
# echo $var1 and $var2 prints actual result.
 now i want to pass these to variable to deploy.sh as params

./deploy.sh $var1 $var2

# I tried to get access to it inside deploy.sh doing folowing
 username=$1 
 pass=$2 #doesn't work comes null

so, when i Run the process it username and password comes null. but If i run the script manually like ./deploy.sh username password, runs fine. Any idea how do i get access to username and password? I tried using import $username and $pass but didn't work.

1

There are 1 best solutions below

0
On

Actually I found what was wrong with my script. I have spaces between variable assignment i.e

 var1 = ${p:environment/username} #spaces
 var2 = ${p:environment/pass} 
 #should have been 
 var1=${p:environment/username} #non spaces
 var2=${p:environment/pass}