[SOLVED] Yaml Parsing Error with gitea-release plugin

Hi @all,

I am fairly new to Drone and using it to deploy a Nodejs application onto a raspberry inside local network. I use appleboy’s scp and ssh plugins to push the code onto the rasberry and restart the services.

Next step is to include release tagging onto the local gitea server. But every time I include that setp I am getting parser errors and I can’t figure out why :frowning:

My yaml looks like this:

kind: pipeline
name: deployment

steps:
   - name: copy_release
     image: appleboy/drone-scp
     settings:
        host: my.pi.server
        username: pi
        password: xxxx
        port: 22
        target: /home/pi/surveillance.home
        source: ./*
        rm: true

   - name: activate_release
     image: appleboy/drone-ssh
     settings:
        host: my.pi.server
        username: pi
        password: xxxx
        port: 22
        command_timeout: 10m
        script:
          - cd ~/surveillance.home/client
          - npm install -y -q --production
          - cd ~/surveillance.home/server
          - npm install -y -q --production
          - mkdir phonebooks
          - cd ~
          - sudo systemctl daemon-reload
          - sudo systemctl restart iSurveillance.service
          - sudo systemctl restart iSurveillanceChecker.service

    - name: tag_release
      image: plugins/gitea-release
      settings:
        api_key: xxxx
        base_url: http://my.gitea.server/
        files: ./*
        title: Release ${DRONE_COMMIT}
      when:
        event: 
          - tag

When removing the gitea_release plugin everything works fine - adding it again I receive the drone error:

yaml: line 34: did not find expected '-' indicator

Actually I have no idea why…

I am using the latest docker image:

drone/drone:latest

Any help is appreciated - thank you :slight_smile:

This appears to be a result of invalid Yaml, as opposed to a problem with the plugin itself. You can use an online yaml validator to verify this http://yaml-online-parser.appspot.com/

The validator gives this error:

ERROR:

while parsing a block collection
  in "<unicode string>", line 5, column 4:
       - name: copy_release
       ^
expected <block end>, but found '<block sequence start>'
  in "<unicode string>", line 35, column 5:
        - name: tag_release
        ^
Examples from YAM

Based on my quick analysis it looks like your spacing is slightly off … the first two steps are indented 3 spaces, and the third step is indented 4 spaces. Uniform spacing is required. Once you resolve the spacing issues the Yaml should parse successfully.

1 Like

:see_no_evil: your are so right … thanks for your help! I need to save the url to the yaml parser. Actually it was a mix of tabs and spaces… arghs.

Now it calls the step - but I receive following message:

time=“2019-04-17T16:03:59Z” level=fatal msg=“The Gitea Release plugin is only available for tags”

I think this is expected, assuming Gitea behaves the same way as GitHub (I do not use Gitea or this plugin). In GitHub a release can only be created for a tag. If Drone is not building a tag, the GitHub release plugin ignores the current build and exits.

Forgive my stupidness - how could I create a tag? Actually I would even prefer to just tag the code and do not create a release (as it is more or less a copy deployment).

Or does it mean I have to trigger the build on tag and create that tag manually?

Thanks!

you would tag your code with git and push (below). Gitea will send a webhook to Drone when you push the tag and will trigger a pipeline execution. The Gitea release plugin would then be used to upload official release binaries to Gitea for your tag, for example.

git tag v1.0.0
git push origin v1.0.0

perfect - thanks a thousand times :raised_hands: