0

I am trying to figure out if i can automate building our little project with the help of drone.io. So far it has been promising, but this simple step i cannot seem to work out.

My setup is gogs with webhooks enabled, and the repo enabled via the drone webinterface. Drone is running in 2 docker instances.

docker-compose.yml:

version: '2'

services:
  drone-server:
    image: drone/drone:0.5
    ports:
      - 8000:8000
    volumes:
      - /opt/docker/drone:/var/lib/drone
      - /path/to/ssh:/key
    environment:
      - DRONE_OPEN=true
      - DRONE_GOGS=true
      - DRONE_GOGS_URL=http://gogs.xx.xx
      - DRONE_GOGS_GIT_USERNAME=user
      - DRONE_GOGS_GIT_PASSWORD=password
      - DRONE_SECRET=key
      - DEPLOY_KEY=@/key/id_rsa
      - DRONE_DEBUG=true

  drone-agent:
    image: drone/drone:0.5
    command: agent
    restart: unless-stopped
    depends_on: [ drone-server ]
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_SERVER=ws://drone-server:8000/ws/broker
      - DRONE_SECRET=key

i had to install the cli separately because i could not get this working within the docker container. Command to sign:

drone -s http://<drone interface>:8000 -t <token copied from webinterface> sign <repo> --in ".drone.yml" --out ".drone.yml.sig"

then i proceeded to commit and push both files to the repo. The following error keeps on coming in the drone debug:

drone-server_1  | time="2017-04-12T10:04:09Z" level=debug msg="cannot verify .drone.yml.sig file. no match"
drone-server_1  | time="2017-04-12T10:04:09Z" level=info ip=172.19.0.1 latency=374.072732ms method=POST path="/hook" status=200 time="2017-04-12T10:04:09Z" user-agent=GogsServer

Any idea what went wrong with signing?

  • the signature cannot be verified if 1) you push the .drone.yml.sig file and then change your yaml, thus invalidating the signature or 2) there have been reported issue signing on windows because the default crlf settings are different from linux. This is described here https://github.com/drone/drone/issues/1662 and can be changed https://help.github.com/articles/dealing-with-line-endings/ – Brad Rydzewski Apr 12 '17 at 16:43

1 Answers1

0

Thank you Brad.

It indeed has to do with line endings. I use a combined windows/linux environment, so i guess thats where it went wrong. Now i use a nifty tool i have used before called dos2unix.

It converts to unix format, after i can successfully sign and push the sig to the repo.