Issues with deploying 'ecs-deploy' using Jenkins

24 views
Skip to first unread message

ji...@edcast.com

unread,
Mar 23, 2017, 1:35:21 PM3/23/17
to Jenkins Users
Hi All,

I am trying to integrate https://github.com/silinternational/ecs-deploy/tree/master with Jenkins to make deployment to ECS easier.
By default Jenkins builds all project using user "jenkins". I have installed ecs-deploy using "jenkins" user and configured aws cli as well.

Below is the script I have written: -

#!/bin/bash
cd ecs-deploy/

SERVICE_NAME="xxxxx"

aws ecs list-services --cluster $SERVICE_NAME > services.json
for ecs_services in `cat services.json | grep arn | tr -d '", ' | awk -F'/' '{print $2}'`;
do
./ecs-deploy -c $SERVICE_NAME -n $ecs_services -i xxxxxxx/yyyyy:${GIT_BRANCH} > output.json
    done
    
if [ $? -eq 0 ]
then
echo "Successfully deployed ECS for $SERVICE_NAME" >> output.json
else
echo "Deployment failed"   
fi

But the script fails on first line it self and runs perfectly when I run the commands manually from the terminal.
Please suggest what am I missing here. Let me know if any more information is required.

Kind Regards,
Jigar Shah
Reply all
Reply to author
Forward
0 new messages