2

My .drone.yml looks like this:

 - name: project
    image: alpine:3.11
    environment:
      DOCKERHUB_USERNAME:
        from_secret: DOCKERHUB_USERNAME
      DOCKERHUB_PASSWORD:
        from_secret: DOCKERHUB_PASSWORD
   volumes:
     - name: dockersock
       path: /var/run/docker.sock
    commands:
      - docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
      - docker-compose pull
      - docker-compose up -d application
      - docker-compose exec -T application /bin/bash -l -c ". /.venv/bin/activate && python manage.py migrate --noinput"
      - docker-compose build --build-arg CACHEBUST=${DRONE_BUILD_CREATED} inttests Nginx
      - docker-compose up -d --remove-orphans reporting tsophiel search application Nginx
      - docker-compose exec -T application /bin/bash -l -c ". /.venv/bin/activate && gunicorn app.wsgi:application -w 3 -t 300 -b :8000 --reload"

and I'm getting /bin/sh: syntax error: unterminated quoted string error on the last command. any thoughts? I'm not the only one who experienced this problem - https://discourse.drone.io/t/unterminated-quoted-string/2009 . So, I think it's drone-related issue. I'm curious how I can fix it or at least debug to understand what's wrong here. Thanks!

UPD.: to fix this error add COMPOSE_INTERACTIVE_NO_CLIvariable:

environment:
  COMPOSE_INTERACTIVE_NO_CLI: "1"
  • I've got the same problem totally unrelated to docker in any way. It occurred after inserting a new command into a step. A few lines after the new command this error occurs. However when I rerun the same build, the error occurs one line earlier. I have no idea how to fix it. – BenjaminH Jul 04 '21 at 14:23

1 Answers1

0

I had similar problem with DroneCI, docker-compose and error that you shared. Unfortunately, your solution did not worked for me, but i found other (very strange) solution.

In my case there was simple commands:

commands:
  - docker-compose -f docker-compose-tests.yml run web python manage.py test
  - docker-compose -f docker-compose-tests.yml down

And removing line docker-compose -f docker-compose-tests.yml down caused, that error /bin/sh: syntax error: unterminated quoted string was not shown anymore.

So if someone face similar issues, you have starting point for digging.

Dawid Gacek
  • 544
  • 3
  • 19