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 
<https://jenkins.lab.karmalabaws.net/job/terraform-deploy-development-mcbranch/140/console#>*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 
> <https://jenkins.lab.karmalabaws.net/job/terraform-deploy-development-mcbranch/140/console#>*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 
> <https://jenkins.lab.karmalabaws.net/job/terraform-deploy-development-mcbranch/140/console#>
>
> *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 
> <https://jenkins.lab.karmalabaws.net/job/terraform-deploy-development-mcbranch/140/console#>*15:27:26*
>   asgName: "lab-us-west-2-lab-rat-serviceInstanceAutoscalingGroup"*15:27:26*  
> [Pipeline] echo 
> <https://jenkins.lab.karmalabaws.net/job/terraform-deploy-development-mcbranch/140/console#>*15:27:26*
>   asgMax: 1*15:27:26*  [Pipeline] echo 
> <https://jenkins.lab.karmalabaws.net/job/terraform-deploy-development-mcbranch/140/console#>*15:27:26*
>   asgMin: 1*15:27:26*  [Pipeline] echo 
> <https://jenkins.lab.karmalabaws.net/job/terraform-deploy-development-mcbranch/140/console#>*15:27:26*
>   Setting ASG size to 1*15:27:26*  1*15:27:26*  [Pipeline] sh 
> <https://jenkins.lab.karmalabaws.net/job/terraform-deploy-development-mcbranch/140/console#>*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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f6560954-54e3-4afd-a8cf-f76bd9de11c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to