Good thinking, I'll try to do a strip on them and see if that clears it up.

On Tuesday, March 12, 2019 at 7:18:14 AM UTC-7, Reinhold Füreder wrote:
>
> Hi Mike,
>
>  
>
> it looks like the variables are actually strings with a line break at the 
> end, and not integers?
>
>  
>
> HTH Reinhold
>
>  
>
> *From:* jenkins...@googlegroups.com <javascript:> <
> jenkins...@googlegroups.com <javascript:>> *On Behalf Of *Mike Craig
> *Sent:* Montag, 11. März 2019 23:33
> *To:* Jenkins Users <jenkins...@googlegroups.com <javascript:>>
> *Subject:* Jenkins Pipeline: Variable expansion issues
>
>  
>
> Hello,
>
>  
>
> The following snippet from my pipeline is acting very strangely, the 
> values from the print statements are correct
>
>  
>
>               print "asgName: $asgName"
>
>              print "asgMax: $asgMax"
>
>              print "asgMin: $asgMin"
>
>              asgIncrease = (asgMax * 2)
>
>              print "Setting ASG size to ${asgIncrease}"
>
>              sh ("aws autoscaling update-auto-scaling-group --min-size ${
> asgMin} --max-size ${asgMax} --region ${region} --auto-scaling-group-name 
> ${asgName} ")
>
>  
>
> output
>
>  
>
> *15:27:13*  ecs_service_name: lab-us-west-2-lab-rat
>
> [Pipeline] sh
>
> *15:27:14*  + aws autoscaling describe-auto-scaling-groups --region us-west-2
>
> *15:27:14*  + jq .AutoScalingGroupName
>
> *15:27:14*  + jq '.AutoScalingGroups[]'
>
> *15:27:14*  + jq 'select (.AutoScalingGroupName | contains 
> ("lab-us-west-2-lab-rat"))'
>
> [Pipeline] sh
>
> *15:27:18*  + aws autoscaling describe-auto-scaling-groups --region us-west-2
>
> *15:27:18*  + jq 'select (.AutoScalingGroupName | contains 
> ("lab-us-west-2-lab-rat"))'
>
> *15:27:18*  + jq .MaxSize
>
> *15:27:18*  + jq '.AutoScalingGroups[]'
>
> [Pipeline] sh
>
> *15:27:22*  + jq 'select (.AutoScalingGroupName | contains 
> ("lab-us-west-2-lab-rat"))'
>
> *15:27:22*  + jq .MinSize
>
> *15:27:22*  + jq '.AutoScalingGroups[]'
>
> *15:27:22*  + aws autoscaling describe-auto-scaling-groups --region us-west-2
>
> [Pipeline] echo
>
> *15:27:26*  asgName: "lab-us-west-2-lab-rat-serviceInstanceAutoscalingGroup"
>
> *15:27:26*  
>
> [Pipeline] echo
>
> *15:27:26*  asgMax: 1
>
> *15:27:26*  
>
> [Pipeline] echo
>
> *15:27:26*  asgMin: 1
>
> *15:27:26*  
>
> [Pipeline] echo
>
> *15:27:26*  Setting ASG size to 1
>
> *15:27:26*  1
>
> *15:27:26*  
>
> [Pipeline] sh
>
> *15:27:26*  + aws autoscaling update-auto-scaling-group --min-size 1
>
> *15:27:27*  usage: aws [options] <command> <subcommand> [<subcommand> ...] 
> [parameters]
>
> *15:27:27*  To see help text, you can run:
>
> *15:27:27*  
>
> *15:27:27*    aws help
>
> *15:27:27*    aws <command> help
>
> *15:27:27*    aws <command> <subcommand> help
>
> *15:27:27*  aws: error: argument --auto-scaling-group-name is required
>
>  
>
> *2 things here, *
>
> 1. the asgIncrease variable should evaluate to 2, as I'm doubling the 
> original variable.  
>
> 2 The line where the "aws autoscaling" command is executed does not expand 
> and execute the entire line. I have tried hardcoding values here, and that 
> seems to work, but how to use variables??
>
>  
>
>  
>
> What am I doing wrong?
>
>  
>
> Thank you!
>
>  
>
>  
>
>  
>
>  
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkinsci-use...@googlegroups.com <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/f6560954-54e3-4afd-a8cf-f76bd9de11c8%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/f6560954-54e3-4afd-a8cf-f76bd9de11c8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b4e1a11d-c488-49af-9bd0-0cffb6c7f68d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to