BitBucket Pipeline unexpected EOF while looking for matching `"' Edited

Good day,

Hi guys, please help me, Ive been trying to get pipeline work with ECS by using tutorial from atlassian link here, and manage to be able to get the docker image through to ECR.

But it just keep failing when executes export TASK_VERSION command, below is the error message, I have tried to find this missing `"' but I havent found it yet. I also include my bitbucket-pipeline.yml & Dockerfile. Thanks in advance. 

Error message :

+ export TASK_VERSION=$(aws ecs register-task-definition --family test_ecs_dev --container-definitions "[{\"name\":\"test_ecs_container\",\"image\":\"$IMAGE_NAME",\"cpu\":10,\"command\":[\"echo\",\"hello\"],\"memory\":10,\"essential\":true}]")
bash: /opt/atlassian/pipelines/agent/tmp/ line 81: unexpected EOF while looking for matching `"' 

Build log screenshot :

Screen Shot 2017-07-01 at 4.23.41 AM.png

bitbucket-pipeline.yml & Dockerfile :

# This is a sample build configuration for Go.
# Check our guides at for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: golang:1.8

    - step:
        script: # Modify the commands below to build your repository.
          - mkdir -pv "${PACKAGE_PATH}"
          - tar -cO --exclude-vcs --exclude=bitbucket-pipelines.yml . | tar -xv -C "${PACKAGE_PATH}"
          - cd "${PACKAGE_PATH}"
          - go get -v
          - go build -v
          - go test -v
          - export IMAGE_NAME=irahardianto/test_ecs:$BITBUCKET_COMMIT
          # build the Docker image (this will use the Dockerfile in the root of the repo)
          - docker build -t $IMAGE_NAME .
          # authenticate with the Docker Hub registry
          - docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
          # push the new Docker image to the Docker registry
          - docker push $IMAGE_NAME
          - curl "" -o ""
          - apt-get update -y
          - apt-get upgrade -y
          - apt-get install -y jq zip unzip
          - unzip
          - ./awscli-bundle/install -b ~/bin/aws
          - export PATH=~/bin:$PATH
          - $(aws ecr get-login --no-include-email --region ap-southeast-1)
          - docker tag $IMAGE_NAME
          - docker push
          # register the ECS task definition and capture the version
          - export TASK_VERSION=$(aws ecs register-task-definition --family test_ecs_dev --container-definitions "[{\"name\":\"test_ecs_container\",\"image\":\"$IMAGE_NAME",\"cpu\":10,\"command\":[\"echo\",\"hello\"],\"memory\":10,\"essential\":true}]" | jq --raw-output '.taskDefinition.revision')
          - echo "Registered ECS Task Definition:" $TASK_VERSION
          # Update the ECS service to use the updated Task version
          - aws ecs update-service --cluster test-ecs-cluster --service test_ecs_service --task-definition test_ecs_dev:$TASK_VERSION

  docker: true
FROM golang:wheezy

# Create app directory
RUN mkdir -p /go/src/app
WORKDIR /go/src/app

COPY . /go/src/app/


WORKDIR /go/src/app
CMD ["go run", "hello.go"]



0 answers

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

2,026 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you