CircleCI-Public / aws-ecs-orb

An orb that simplifies deployment to Amazon's Elastic Container Service (ECS). Supports both EC2 and Fargate launch types.
https://circleci.com/orbs/registry/orb/circleci/aws-ecs
MIT License
51 stars 80 forks source link

asterisk in task definition replaced with update_container_defs #89

Closed michaelanthonymain closed 4 years ago

michaelanthonymain commented 4 years ago

Orb version

version 1.0.4

What happened

Used aws-ecs/update-service in a job to deploy a task definition with a command property. The service is a scheduler and takes a flag as an argument specifying a schedule in cron syntax, e.g. -schedule="30 10 * * 4". When the task definition is updated in ecs, the command looks like this -schedule="30 10 _update_container_defs.py.V2o99u _update_container_defs.py.V2o99u 4".

Expected behavior

Ideally, when the task definition is updated in ecs, the command would read -schedule="30 10 * * 4". Seems like this could be an issue due to bash filename expansion -- maybe somewhere around here: https://github.com/CircleCI-Public/aws-ecs-orb/blob/master/src/orb.yml.hbs#L644

lokst commented 4 years ago

@michaelanthonymain Thanks for reporting this! May I know if the command you are referring to is found in a container definition e.g.

{
  "containerDefinitions": [
    {
      "memory": 32,
      "essential": true,
      "entryPoint": [
        "ping"
      ],
      "name": "alpine_ping",
      "readonlyRootFilesystem": true,
      "image": "alpine:3.4",
      "command": [
        "-c",
        "4",
        "google.com"
      ],
      "cpu": 16
    }
  ],
  "family": "example_task_2"
}

If you could give an excerpt of the command array as specified in the task definition that would be really helpful for our tests!

michaelanthonymain commented 4 years ago

@lokst Yea, no problem! It looks like this in aws after the deploy:

      "command": [
        "/cmd",
        "-type",
        "type",
        "-sqs-url",
        "url",
        "-schedule",
        "30 10 _update_container_defs.py.V2o99u _update_container_defs.py.V2o99u 4"
      ],

it looks like this in the task definition in code before deploy:

"command": ["/cmd", "-type", "type", "-sqs-url", "${SQS_URL}", "-schedule", "30 10 * * 4"],
lokst commented 4 years ago

Thanks a lot @michaelanthonymain , I'll try to reproduce this!

michaelanthonymain commented 4 years ago

Thank you!

lokst commented 4 years ago

@michaelanthonymain Thank you for your patience; a fix for this has been released as circleci/aws-ecs@1.0.5 🙂

michaelanthonymain commented 4 years ago

thank you, @lokst !