Code Monkey home page Code Monkey logo

drovah's Introduction

drovah

build status docker pulls

Simple, fast, standalone continuous integration service written in Rust

This project is entirely for fun and building on my rust knowledge, however, was created for the purpose of being an ultra lightweight, fast and painless implementation of a continuous integration service.

drovah comes with a basic frontend that will allow you to download any archived files as well as view past build statuses!

Development

You can follow the development of new features here

If you want a feature I don't current have planned, please create an issue!

Current Features

  • Stupid simple configuration
  • Supports whatever build tool you want
  • Simple frontend supporting viewing previous build statuses and downloading per build archived files
  • Minimal resource usage (the demo above is running on 6MB of RAM)
  • GitHub Webhook support for automation (includes the use of secure token to ensure security)
  • Successful build archival (numerous builds)
  • Support for post archival actions

Setup

Prerequisites:

  • Rust
  • git
  • MySQL server
  • npm

From source

backend

  1. cd backend
  2. cargo build --release
  3. Done.

Frontend

  1. cd frontend
  2. npm install
  3. npm run build
  4. Done.

From docker

First off I apologise, it's a bit more work than I would like setting this up, and I aim to improve that in the future!

  1. Pull the available image here
  2. Refer to MySQL setup
  3. Set required ENV variables and run!

Configuration

You have two required settings to configure, the database and the github secret! Although optionally you can change the bind address

Simply create a .env containing the following

DATABASE_URL=mysql://user:pass@localhost:3306
GITHUB_SECRET=secretgoeshere

Note for GITHUB_SECRET, use something like ruby -rsecurerandom -e 'puts SecureRandom.hex(20)' to generate the secret

And if you wish to change the bind address, add BIND_ADDRESS=127.0.0.1:8080

MySQL setup

  1. Install diesel_cli
  2. Run diesel migration run in the backend directory
  3. Done

In your project

Simple create a .drovah file in the root of your project

Example .drovah file

[build]
commands = ["gradle clean build"]

[archive]
files = ["build/libs/someproject-"]
append_buildnumber = true

[postarchive]
commands = ["echo 'woohoo' >> somefile"]

Explanation of configuration options

build must be an array of strings which will represent your commands, they are run in order.

(OPTIONAL SECTION) archive

files must be an array of strings containing path/pattern of files, relative path of your project. This will attempt to match the filename, eg, the above [archive] configuration will match both of these files

append_buildnumber must be a boolean, this option just applies the current build number to the final archived files

  • 'build/libs/someproject-1.1.jar'
  • 'build/libs/someproject-wahoo.txt'

(OPTIONAL SECTION) postarchive

commands must be an array of strings which will represent commands to be run AFTER successful builds, they are run in order. The running context of these commands is the drovah binary location.

Managing projects

Just git clone <repo> in the data/projects/ folder and insert a project to the projects table of the database, and then webhooks will be supported instantly

Similarly, just remove the folders you no longer want to track

Webhook

The webhook by default is available at http://<host>:<port>/webhook

This webhook is targetted at GitHub, and can be set up using the application/json payload.

It will also require a secret which can be set locally through the GITHUB_SECRET environment variable

If you want to build from some other source, here's an example payload

{
    "repository": {
        "name": "drovah"
    }
}

This will attempt to build the drovah project, if data/projects/drovah/ does not exist, or doesn't contain a .drovah file, the build will fail

Note when removing a project, also remove it from the database!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.