1

I have a project which used Codeship Pro and i have successfully push to Docker Hub, and after that i want to push my project to AWS EC2 Container Service with it.

I followed this documentation:

https://documentation.codeship.com/pro/continuous-deployment/aws/

- service: awsdeployment
  command: aws ecs register-task-definition --cli-input-json file:///deploy/tasks/backend.json
- service: awsdeployment
  command: aws ecs update-service --service my-backend-service --task-definition backend

The problem is in documentation, it doesn't explain what deploy/tasks/backend.json contain, i tried to remove it in codeship-steps.yml

- service: awsdeployment
  command: aws ecs update-service --service my-backend-service --task-definition backend

But the result is: An error occurred (ClientException) when calling the UpdateService operation: TaskDefinition not found.

Currently, i use

ecs-cli compose up

it push my project to my EC2 Container Service using my docker-compose.yml

I spend a long day to figure it out, but still i have no idea to successfully push to my AWS ECS, i can't use ecs-cli command when pushing with shipcode. What should i do ?

calvin sugianto
  • 610
  • 7
  • 27
  • The `aws ecs` command is calling the AWS CLI (which is preinstalled in the image you are using for deploying to AWS). The required options are explained in more detail on the AWS CLI documentation, see http://docs.aws.amazon.com/cli/latest/reference/ecs/update-service.html for the `update-service` command for ECS. – mlocher May 03 '17 at 07:12
  • can we use ecs cli commands like i used: 'ecs-cli compose up' on codeship services ? – calvin sugianto May 03 '17 at 07:37
  • Not via the container that we provide, as it only has the AWS CLI installed but the AWS ECS CLI. You can however build a Docker image with the ECS CLI installed (or search for it on Docker Hub) and then use that image to run your commands. – mlocher May 03 '17 at 07:38
  • alright, how about push via aws registry (ECR)? it seems more simpler than use AWS-CLI. I have tried that one, but in the end, it said wrong username even though i have include the auth in my dockercfg file. Is it possible to use this method? source: https://blog.codeship.com/aws-registry/ – calvin sugianto May 03 '17 at 11:29
  • Sure, you can use our generic tutorial on pushing to a remote registry for this, see https://documentation.codeship.com/pro/builds-and-configuration/image-registries/#pushing-images-to-registries in combination with the dockercfg generator for AWS ECR, https://github.com/codeship-library/aws-utilities/blob/master/dockercfg-generator/README.md – mlocher May 04 '17 at 09:41

0 Answers0