Skip to content

L00kAhead/gitea-drone-ci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self-Hosted Git Repository & CI/CD Pipeline (Gitea + Drone)

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.

Architecture

The architecture consists of two main components:

  1. Gitea: A lightweight, self-hosted Git service that provides a web interface for managing repositories, issues, and pull requests.
  2. Drone: A continuous integration and delivery platform that integrates with Gitea to automate the build, test, and deployment processes.

Architecture Diagram

Setup Instructions

  1. 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
  2. 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
  3. Docker Compose: Use the provided docker-compose.yml file to set up the Gitea and Drone services. Run the following command in the terminal:

    docker-compose up -d
  4. Access Gitea: Open your web browser and navigate to http://localhost:3000 or http://<your-server-ip>:3000 to access the Gitea web interface. Follow the on-screen instructions to complete the initial setup, including creating an admin account and configuring the database.

  5. Access Drone: Open another tab in your web browser and navigate to http://localhost:8080 or http://<your-server-ip>:8080 to access the Drone web interface. Follow the on-screen instructions to complete the initial setup, including connecting Drone to your Gitea instance.

  6. Create Repositories: In Gitea, create new repositories for your projects. You can do this through the web interface by clicking on "New Repository".

  7. 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/login or http://<your-server-ip>:8080/login depending on your setup.
  8. 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.yml file in your repository to define your CI/CD pipeline.

LICENSE

This project is licensed under the MIT License - see the LICENSE file for details

About

This repository contains configuration files and documentation for setting up a self-hosted Git repository using Gitea and a CI/CD pipeline using Drone.

Topics

Resources

License

Stars

Watchers

Forks

Contributors