I have Gitea, Drone, and a Drone runner setup in containers and I was able to use Oauth between Gitea and Drone to login to Drone. Drone can see all my repos. I activated one of them, added the drone yaml and did a push. (Also have activated via Test deliveries).
Each time I get the following error:
Initialized empty Git repository in /drone/src/.git/
In addition to setting the runner networks, the gitea clone url must match the gitea container hostname. See [SOLVED] Git clone step adding wrong origin address. This issue comes up pretty frequently so you might also consider searching this forum and reviewing other threads for solutions. I also recommend reaching out in the gitea support forum to see if someone has a working configuration you can use.
Please post your full installation / configuration. Are you using docker-compose? What hostname does docker compose use when linking your container environments to the shared network? If you are not using docker-compose how have you linked the container networks? We know for certain this is a networking issue, however, it is unclear what you configuration looks like.
Where is this resolution failing? The Drone container or the runner? Because if I enter the drone container, I can run the following:
For the runner, I added it to the hosts file and so I get the following:
Resolution does not happen in either of these containers – the clone does not happen in either of these containers. Drone creates a new container for each pipeline step including the clone step.
Here are some existing threads that address this error and some of your questions:
I really do recommend asking for a working configuration in the Gitea forums. Many of the Gitea maintainers are also Drone contributors and can probably provide you with a sample docker-compose file that you can use as reference.
I’ve tried with and without the networks directive and with and without the hostname directive.
Here are my drone env variables:
DRONE_GITEA_CLIENT_SECRET: my secret
DRONE_GITEA_SERVER: http://gitea.mushroomkingdom:3000
DRONE_GITEA_CLIENT_ID: the client id
DRONE_SERVER_HOST: drone.mushroomkingdom:8087
DRONE_SERVER_PROTO: http