Gitea release plugin

Hi,

I just started using drone. I tried to use the gitea release plugin, but I get an error message:
time="2019-08-19T12:45:36Z" level=fatal msg="You must provide an API key"
I did provide an API key. I created a token for the drone user, that should be enough I think?

And my gitea is installed via a subpath /gitea. I hope that’s ok for the plugin.

It sounds like you hare having issues with the plugin reading the value or reading the value from the secret. In order to help you debug, we will need to see all of the below information:

  1. version of Drone you are using
  2. a copy of your yaml configuration file.
  3. the output of drone secret ls for your repository.
  4. provide the output of drone build info for the failing build.
  5. if you are using drone exec please make this clear
  1. 1.2.3
clone:
  CLONE REPO:
    image: plugins/git
    depth: 1

pipeline:
  COMPILE:
    image: golang:1.12.9-buster
    commands:
      - go mod download
      - go build
  PUSH:
    image: plugins/gitea-release
    settings:
      api_key:
        from_secret: gitea_token
      base_url: https://xxx/gitea
      files: gohome
    when:
      event: tag
  1. How do I do that? My drone is running in Docker.
  2. time="2019-08-19T12:56:28Z" level=fatal msg="You must provide an API key"

for 3 & 4 you need to install the CLI and provide your API token:

https://docs.drone.io/cli/install/
https://docs.drone.io/cli/setup/

edit: I do not need 3 and 4 to diagnose the issue. The problem is with the yaml. You seem to be mixing 0.8 and 1.0 syntax which is not going to work as expected.

Since you are using 1.0 I recommend using 1.0 syntax. Here are some useful resources:

kind: pipeline
name: default
steps:
  - name: CLONE REPO
    image: plugins/git
    depth: 1

  - name: COMPILE
    image: golang:1.12.9-buster
    commands:
      - go mod download
      - go build
  - name: PUSH
    image: plugins/gitea-release
    settings:
      api_key:
        from_secret: gitea_token
      base_url: https://xxx/gitea
      files: gohome
    when:
      event: tag

I changed the config to this. But it still shows me the same error message.

this is not valid syntax and should be removed. see https://docs.drone.io/user-guide/pipeline/cloning/

Then I need to see the following information:

  1. the output of drone secret ls <your/repo> for your repository.
  2. the output of drone build info <your/repo> <build-number> for the failing build.

The root cause for this error is incorrect secret configuration. However, I cannot advise without the above information.

1 Like
[email protected] ~/Downloads $ drone secret ls buddy/gohome
gitea_token 
Pull Request Read:  false
Pull Request Write: false

[email protected] ~/Downloads $ drone build info buddy/gohome
Number: 17
Status: failure
Event: push
Commit: d979062bff284155d1025c08a08dd7bd2fa1f106
Branch: master
Ref: refs/heads/master
Author:  <[email protected]>
Message: fix

Thank you so much for helping me.

thank you a lot for your help. Now it is finally working :smiley: