[SOLVED] Gogs+drone webhook does not trigger builds

#1

I push the .drone.yml to gogs,but drone no build it


I want to know the reason.

0 Likes

#2

We have a dedicated thread that discusses all possible root causes. See Nothing happens when I push code, no builds, or builds stuck in pending.

0 Likes

#3

The gogs webhook seem Ok

0 Likes

#4

I have set debug mode,and use
docker logs to see log
but I can’t find “push”


from the gogs ,it seems Ok

0 Likes

#5

If you do not see anything in the logs, it means the request was not delivered to Drone. This typically indicates Gogs is unable to reach Drone.

0 Likes

#6

I use docker-compose to create Drone and gogs separately,so Gogs is unable to reach Drone.
now I create them in same network,but I meet a new question.


default: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I have change the .drone.yml format to 1.
I think that it need sudo docker.Could you help me.

0 Likes

#7

This error often indicates Drone was misconfigured. It would be helpful when posting issues to provide more detail, such as the configuration you are using.

0 Likes

#8

version: ‘3’

services:
drone-server:
container_name: drone-server
image: drone/drone:latest
ports:
- “36000:80”
- 8443:443
- 9000
volumes:
- ./var/run/docker.sock:/var/run/docker.sock
- ./var/lib/drone:/data

environment:
  - DRONE_LOGS_DEBUG=true
  - DRONE_GIT_ALWAYS_AUTH=false
  - DRONE_SERVER_HOST=172.20.30.203
  - DRONE_GOGS_SERVER=http://172.20.30.203:10080
  - DRONE_SERVER_PROTO=http
  - DRONE_TLS_AUTOCERT=false
  - DRONE_RPC_SECRET=ALQU2M0KdptXUdTPKcEw
restart: always
networks:
  - drone_net

gogs:
container_name: gogs
image: gogs/gogs
ports:
- “10022:22”
- “10080:3000”
volumes:
- ./var/gogs:/data
restart: always
depends_on:
- gogs-mysql
links:
- gogs-mysql:db
networks:
- drone_net

gogs-mysql:
container_name: gogs-mysql
image: mysql:latest
ports:
- 3306:3306
volumes:
- ./opt/mysql/mysqlVolume:/var/lib/mysql
- ./var/run/docker.sock:/var/run/docker.sock
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: pass
MYSQL_DATABASE: gogs
MYSQL_USER: gogs
MYSQL_PASSWORD: pass
TZ: Asia/Shanghai

restart: always
networks:
   - drone_net

drone-agent:
container_name: drone-agent
image: drone/agent:latest
command: agent
depends_on:
- drone-server
volumes:
- ./var/run/docker.sock:/var/run/docker.sock

environment:
  - DRONE_RPC_SERVER=http://drone-server
  - DRONE_RPC_SECRET=ALQU2M0KdptXUdTPKcEw

restart: always
networks:
  - drone_net

networks:
drone_net:
driver: bridge

0 Likes

#9

0 Likes

#10

You are missing DRONE_AGENTS_ENABLED=true

This parameter is required when using agents, otherwise Drone runs in single-machine mode where the server executes builds directly. Setting DRONE_AGENTS_ENABLED=true will prevent the error.

However, if you are running everything on a single server, you really do not need agents. You should instead follow the single-machine installation instructions, which is the optimal configuration for a single server, and does not require agents. https://docs.drone.io/installation/gogs/single-machine/

I am going to close this thread as solved since we have solved the original issue(s). New threads can be opened for new topics.

0 Likes