Skip to content

ruanbekker/drone-gitea-on-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drone-gitea-on-docker

DroneCI and Gitea on Docker

Usage

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 to http://${IP_ADDRESS}:3001/login

  • Capture the client id and client secret and populate them in the boot.sh in DRONE_GITEA_CLIENT_ID and DRONE_GITEA_CLIENT_SECRET and run bash 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.

Drone CLI

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

Build your first pipeline

Create a test repo in gitea:

image

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:

image

Activate your repository:

image

Push a commit to master and see your pipeline running:

image

More Examples

Releases

No releases published

Packages

No packages published

Languages