This repository contains configuration files and documentation for setting up a self-hosted Git repository using Gitea and a CI/CD pipeline using Drone. The goal is to provide a complete solution for version control and continuous integration/deployment in a self-hosted environment.
The architecture consists of two main components:
- Gitea: A lightweight, self-hosted Git service that provides a web interface for managing repositories, issues, and pull requests.
- Drone: A continuous integration and delivery platform that integrates with Gitea to automate the build, test, and deployment processes.
-
Make directory: Create a directory on your local machine or server where you want to set up the Gitea and Drone services. Navigate to that directory in your terminal:
mkdir gitea-drone-ci cd gitea-drone-ci touch .env // copy the env_config file content to .env file and update the values as needed -
Clone the Repository: Clone this repository to your local machine or to your linux server running locally or remote(just make sure git is installed):
git clone https://github.com/L00kAhead/gitea-drone-ci.git
-
Docker Compose: Use the provided
docker-compose.ymlfile to set up the Gitea and Drone services. Run the following command in the terminal:docker-compose up -d
-
Access Gitea: Open your web browser and navigate to
http://localhost:3000orhttp://<your-server-ip>:3000to access the Gitea web interface. Follow the on-screen instructions to complete the initial setup, including creating an admin account and configuring the database. -
Access Drone: Open another tab in your web browser and navigate to
http://localhost:8080orhttp://<your-server-ip>:8080to access the Drone web interface. Follow the on-screen instructions to complete the initial setup, including connecting Drone to your Gitea instance. -
Create Repositories: In Gitea, create new repositories for your projects. You can do this through the web interface by clicking on "New Repository".
-
Create CLIENT ID and SECRET: In Gitea, navigate to your user settings and create a new application to obtain a CLIENT ID and SECRET. Paste it in the .env file for DRONE_GITEA_CLIENT_ID and DRONE_GITEA_CLIENT_SECRET respectively.
- In the URI field, enter
http://localhost:8080/loginorhttp://<your-server-ip>:8080/logindepending on your setup.
- In the URI field, enter
-
Configure Drone: Open Drone Web UI authorize the application and then click on your repository and click on activate to link it with Drone. You can then create a
.drone.ymlfile in your repository to define your CI/CD pipeline.
This project is licensed under the MIT License - see the LICENSE file for details
