Created
May 1, 2018 05:05
-
-
Save gouravtiwari/e3d0381ddb4b82cc275f5588f71af239 to your computer and use it in GitHub Desktop.
Get task definition via Ruby thread in shell of Jenkins job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SERVICES=`aws ecs list-services --cluster ABCD` | |
CLUSTER="ABCD" | |
ruby <<EOM | |
require "open3" | |
ecs_service_name = 'abcd-ecs-service-stack-ABCDApplication-XXXXXXXXXXXXX' | |
puts ecs_service_name | |
# sleep 2 | |
task_definition = Open3.popen3("aws ecs describe-services --cluster $CLUSTER --services #{ecs_service_name} --query services[*].taskDefinition --output text"){ |i, o| p o.read } | |
puts "task_definition: #{task_definition}" | |
EOM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment