josmo / drone-ecs

Drone plugin for triggering Amazon EC2 Container Service (ECS) deployments
Apache License 2.0
30 stars 41 forks source link

Attempting to support other Task variables in order to support FARGATE launch type #28

Closed mlibrodo closed 6 years ago

mlibrodo commented 6 years ago

In order to support the fargate launch type, the cpu, memory, execution_role, task_execution_role_arn needs to be specified in RegisterTaskDefinitionInput. I just went ahead and exposed these to drone. i believe it should address issue #27

Sample drone config

  deploy:
    image: mlibrodo/drone-ecs:latest
    when:
      branch: master
    access_key: XXXXXXXX
    secret_key: XXXXXXXX
    region: us-east-2
    family: task-definition-family
    docker_image: namespace/repo
    container_name: container1
    tag: latest
    cluster: some-fargate-cluster
    service: some-service
    task_network_mode: awsvpc
    port_mappings:
      - 9000 9000
    deployment_configuration: 50 200
    log_driver: awslogs
    log_options:
      - awslogs-group=/ecs/someservice
      - awslogs-region=us-east-2
      - awslogs-stream-prefix=ecs
    environment_variables:
      - SERVICE_CONFIG=XXXXX
    cpu: 4096
    memoryReservation: 128
    task_cpu: 4096
    task_memory: 8192
    task_execution_role_arn: arn:aws:iam::XXXXX:role/ecsTaskExecutionRole
    compatibilities: FARGATE EC2
    desired_count: 2
josmo commented 6 years ago

Seems reasonable to me. Thanks for the contribution @mlibrodo