DroneCI and Gitea on Docker
Set the following in your boot.sh
:
IP_ADDRESS=192.168.0.6 -> either reachable dns or ip address which will be your clone address and ui addresses.
GITEA_ADMIN_USER="giteauser" -> will be the user you register with in drone
Now boot the stack:
$ bash boot.sh
Note: Theres a current issue where webhooks get fired twice, if you see that just restart gitea with docker restart gitea
.
-
Head over to:
http://${IP_ADDRESS}:3000/user/settings/applications
and create a new OAuth2 Application and set the Redirect URI tohttp://${IP_ADDRESS}:3001/login
-
Capture the client id and client secret and populate them in the
boot.sh
inDRONE_GITEA_CLIENT_ID
andDRONE_GITEA_CLIENT_SECRET
and runbash boot.sh
again. This will give drone the correct credentials in order to authenticate with gitea. -
Now when you head over to
http://${IP_ADDRESS}:3001/
you will be asked to authorize the application and you should be able to access drone.
Install Drone CLI:
$ curl -L https://github.com/drone/drone-cli/releases/latest/download/drone_darwin_amd64.tar.gz | tar zx
$ sudo mv drone /usr/local/bin/drone
$ chmod +x /usr/local/bin/drone
Get your Drone Token:
- http://${IP_ADDRESS}:3001/account
$ export DRONE_SERVER=http://${IP_ADDRESS}:3001
$ export DRONE_TOKEN=one-from-the-account-page
drone info
Create a test repo in gitea:
Commit a .drone.yml
file for drone:
$ cat .drone.yml
kind: pipeline
type: docker
name: hello-world
trigger:
branch:
- master
event:
- push
steps:
- name: say-hello
image: busybox
commands:
- echo hello-world
Head over to drone and sync your repositories:
Activate your repository:
Push a commit to master and see your pipeline running:
- https://github.com/ruanbekker/drone-ci-testing
- https://github.com/ruanbekker/drone-demo-python-flask
- https://github.com/ruanbekker/drone-with-go
- https://github.com/ruanbekker/demo-drone-mongodb-tests
- https://github.com/ruanbekker/drone-multi-pipeline
- https://github.com/ruanbekker/docker-jekyll-drone
- Localstack with Drone and Gitea
- Drone, Minio, Gitea, Sqlite on Docker Compose