When a new tag is pushed on gitea, the pipeline on drone cannot be triggered

This problem has been bothering me for a long time. It is unfortunate that the problems I found on ‘discourse’ are not the same.

So I just created this topic and hope that Mr. bradrydzewski can read and help me solve the problem, thank you!

Running

  1. Run drone/drone:latest&drone/agent:latest with docker
  2. Use docker to run gitea/gitea:latest as a git repository
version: '3'
services:
  drone:
    image: drone/drone:latest
    ports:
      - 127.0.0.1:4080:80
    volumes:
      - /opt/drone/data:/data
    environment:
      ......
    container_name: drone
    restart: always

  runner:
    image: drone/agent:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      - drone
    environment:
      ......
    container_name: runner
    restart: always

Problem

When a new tag is pushed on gitea, the pipeline on drone cannot be triggered.

My .drone.yaml is written according to the documentation standard and is very simple and clear.

---
kind: pipeline
type: docker
name: default

platform:
  os: linux
  arch: amd64

steps:
- name: build
  image: golang:latest
  environment:
    GOOS: linux
    GOARCH: amd64
    CGO_ENABLED: 0
  commands:
  - go build -o yourip
  - go test

- name: docker
  image: plugins/docker
  settings:
    username:
      from_secret: DOCKER_REGISTRY_USERNAME
    password:
      from_secret: DOCKER_REGISTRY_PASSWORD
    repo: registry.otokaze.cn/yourip
    registry: registry.otokaze.cn
    auto_tag: true
  when:
    ref:
    - refs/tags/v*
...

Logs

When I normally used git push origin v1.0.0 to create a remote tag, drone-server returned the following log.

[{
	"commit": "c7d694b4a75c7f36a0e5da6264ffac929c5705b0",
	"event": "tag",
	"level": "info",
	"msg": "trigger: skipping pipeline, does not match branch",
	"pipeline": "default",
	"ref": "refs/tags/v0.0.3",
	"repo": "otokaze/yourip",
	"time": "2019-11-14T17:18:40Z"
}, {
	"commit": "c7d694b4a75c7f36a0e5da6264ffac929c5705b0",
	"event": "tag",
	"level": "info",
	"msg": "trigger: skipping build, no matching pipelines",
	"pipeline": "default",
	"ref": "refs/tags/v0.0.3",
	"repo": "otokaze/yourip",
	"time": "2019-11-14T17:18:40Z"
}]

I tried using ref:refs/tags/v* instead of branch:master in the trigger. Even I removed all the conditions, but I couldn’t trigger the drone to execute the pipeline.

I’m going to crumble :sob:

help me, please!

I’m going to crumble :sob:

You can try modify your trigger to:

when:
    event:
    - tag
    ref:
    - refs/tags/v*

Thank you for your reply!
But unfortunately, it still doesn’t work :frowning:

Operation

➜  yourip git:(master) git push origin-gitea  v0.0.3  
Total 0 (delta 0), reused 0 (delta 0)
To ssh://git.otokaze.cn:3022/otokaze/yourip.git
 * [new tag]         v0.0.3 -> v0.0.3
➜  yourip git:(master) 

Drone Server Logs

{"commit":"c7d694b4a75c7f36a0e5da6264ffac929c5705b0","event":"tag","level":"info","msg":"trigger: skipping pipeline, does not match branch","pipeline":"default","ref":"refs/tags/v0.0.3","repo":"otokaze/yourip","time":"2019-11-21T14:59:13Z"}
{"commit":"c7d694b4a75c7f36a0e5da6264ffac929c5705b0","event":"tag","level":"info","msg":"trigger: skipping build, no matching pipelines","pipeline":"default","ref":"refs/tags/v0.0.3","repo":"otokaze/yourip","time":"2019-11-21T14:59:13Z"}

Did you set .drone.yaml not .drone.yml in drone ci repo setting?

I’m sure I’m using .drone.yaml, not .drone.yaml. :slight_smile:

give a try:
edit drone.yml

- name: docker
  image: plugins/docker
 ...   
  when:
       event:  [ tag ]
       branch: [ refs/tags/v* ]