I can't seem to make the ECS deploy image run properly. Even when using you example code.
Here's the last few lines of the pipeline output. I had DEBUG turned on:
5b3de3e43369: Pull complete
6fa0d3662c46: Pull complete
Digest: sha256:1aa9f89c0c38960914214a2b71cdd11ebb7d39c0dde4d8f934541453ff1e1555
Status: Downloaded newer image for bitbucketpipelines/aws-ecs-deploy:1.0.0
INFO: Updating the task definition...
DEBUG: Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
DEBUG: Changing event name from before-call.apigateway to before-call.api-gateway
DEBUG: Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
DEBUG: Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
DEBUG: Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
DEBUG: Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
DEBUG: Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
DEBUG: Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
DEBUG: Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
DEBUG: Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
DEBUG: Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
DEBUG: Looking for credentials via: env
INFO: Found credentials in environment variables.
DEBUG: Loading JSON file: /usr/local/lib/python3.7/site-packages/botocore/data/endpoints.json
DEBUG: Event choose-service-name: calling handler <function handle_service_name_alias at 0x7f759adc44d0>
DEBUG: Loading JSON file: /usr/local/lib/python3.7/site-packages/botocore/data/ecs/2014-11-13/service-2.json
DEBUG: Event creating-client-class.ecs: calling handler <function add_generate_presigned_url at 0x7f759adfd290>
DEBUG: The s3 config key is not a dictionary type, ignoring its value of: None
DEBUG: Setting ecs timeout as (60, 60)
DEBUG: Loading JSON file: /usr/local/lib/python3.7/site-packages/botocore/data/_retry.json
DEBUG: Registering retry handlers for service: ecs
✖ Failed to parse the task definition file: invalid JSON provided.
Here is my task-definition-template.json file:
{
"family": "",
"executionRoleArn": "arn:aws:iam::#########:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"name": "aft-cms-api",
"image": "${IMAGE_NAME}",
"portMappings": [
{
"hostPort": 80,
"protocol": "tcp",
"containerPort": 80
}
],
"secrets": [
{
"valueFrom": "arn:aws:ssm:us-east-1:#########:parameter/CMS-APP-SECRET-DEV",
"name": "AppSettings__Secret"
},
{
"valueFrom": "arn:aws:ssm:us-east-1:###########:parameter/CMS-DB-CONN-INFO-DEV",
"name": "ConnectionStrings__AFTDataContext"
}
]
}
],
"memory": "512",
"taskRoleArn": "arn:aws:iam::###########:role/ecsTaskExecutionRole",
"compatibilities": [
"EC2",
"FARGATE"
],
"requiresCompatibilities": [
"FARGATE"
],
"networkMode": "awsvpc",
"cpu": "256"
}
How are you running envsubst? I was noticed that when I tried to use the docker command for it (which I might have been using incorrectly), it would spit out an empty JSON file. So now I'm using this.
- apk add gettext
- export IMAGE_NAME="asdf"
- envsubst < task-definition-template.json > task-definition.json
The first line of my bitbucket-pipelines.yml file is:
image: python:3.7.4-alpine3.10
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.