Hi All,
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