Code Monkey home page Code Monkey logo

rabbit's Introduction

Rabbit Logo

Rabbit

A lightweight service that will build and store your go projects binaries.

Rabbit is a lightweight service that will build and store your go projects binaries. Once a VCS system (github or bitbucket) notifies rabbit of a new release, it clones the project, builds different binaries and publish them.


Screenshot


Documentation

Development:

Rabbit uses Go Modules to manage dependencies. First Create a prod config file.

$ git clone https://github.com/Clivern/Rabbit.git
$ cp config.dist.yml config.prod.yml

Then add your configs

# General App Configs
app:
    # Env mode (dev or prod)
    mode: dev
    # HTTP port
    port: 8080
    # App URL
    domain: http://127.0.0.1:8080
    # TLS configs
    tls:
        status: off
        pemPath: cert/server.pem
        keyPath: cert/server.key

# Redis Configs
redis:
    addr: localhost:6379
    password:
    db: 0

# Message Broker Configs
broker:
    # Broker driver (native or redis)
    driver: native
    # Native driver configs
    native:
        # Queue max capacity
        capacity: 50
        # Number of concurrent workers
        workers: 1
    # Redis configs
    redis:
        channel: rabbit

# Log configs
log:
    # Log level, it can be debug, info, warn, error, panic, fatal
    level: debug
    # output can be stdout or abs path to log file /var/logs/rabbit.log
    output: stdout
    # Format can be json or text
    format: json

# Release configs
releases:
    # Releases absolute path
    path: /app/var/releases
    name: "[.Tag]"

# Build configs
build:
    # Build absolute path
    path: /app/var/build
    # Number of parallel builds
    parallelism: 1

# Application Database
database:
    # Database driver (redis)
    driver: redis
    # Redis
    redis:
        hash_prefix: rabbit_

# Third Party API Integration
integrations:
    # Github Configs
    github:
        # Webhook URI (Full URL will be app.domain + webhook_uri)
        webhook_uri: /webhook/github
        # Webhook Secret (From Repo settings page > Webhooks)
        webhook_secret: Pz2ufk7r5BTjnkOo
        # whether to use ssh or https to clone
        clone_with: https
        # HTTPS URL format, Full name will be something like Clivern/Rabbit
        https_format: https://github.com/{$full_name}.git
        # SSH URL format, Full name will be something like Clivern/Rabbit
        ssh_format: [email protected]:{$full_name}.git
    # Bitbucket Configs
    bitbucket:
        # Webhook URI (Full URL will be app.domain + webhook_uri)
        webhook_uri: /webhook/bitbucket
        # whether to use ssh or https to clone
        clone_with: https
        # HTTPS URL format, Full name will be something like Clivern/Rabbit
        https_format: https://bitbucket.org/{$full_name}.git
        # SSH URL format, Full name will be something like Clivern/Rabbit
        ssh_format: [email protected]:{$full_name}.git

And then run the application.

$ go build rabbit.go
$ ./rabbit

// OR

$ go run rabbit.go

// To Provide a custom config file
$ ./rabbit -config=/custom/path/config.prod.yml
$ go run rabbit.go -config=/custom/path/config.prod.yml

Deployment

Rabbit needs a decent resources to be able to work properly because the build process itself done by goreleaser and it consumes a lot. So keep build.parallelism equal 1 and increase if you have more resources and would like to speed the build process.

On a Linux Server

Make sure you have git, golang 1.12 and goreleaser installed, and make goreleaser executable from everywhere.

# To download the latest goreleaser binary for linux (https://github.com/goreleaser/goreleaser/releases)
$ curl -sL https://github.com/goreleaser/goreleaser/releases/download/v0.108.0/goreleaser_Linux_x86_64.tar.gz | tar xz

Also make sure you are able to clone all your repositories in a non-interactive way. Just configure ssh-key and add the remote VCS to your known hosts.

Then download the latest Rabbit binary.

$ curl -sL https://github.com/Clivern/Rabbit/releases/download/x.x.x/rabbit_x.x.x_OS.tar.gz | tar xz

Create your config file as explained before on development part and run rabbit with systemd or anything else you prefer.

$ ./rabbit -config=/custom/path/config.prod.yml

On Docker

Running rabbit with docker-compose is pretty straightforward.

$ git clone https://github.com/Clivern/Rabbit.git
$ cd Rabbit/deployments/docker-compose
$ docker-compose build
$ docker-compose up -d

Docker will mount you host server ~/.ssh directory in order to be able to clone repositories that need ssh key. Please make sure it has the right permissions and also remote VCS added to known hosts. otherwise rabbit will stuck on git interactive clone.

Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, Rabbit is maintained under the Semantic Versioning guidelines and release process is predictable and business-friendly.

See the Releases section of our GitHub project for changelogs for each release version of Rabbit. It contains summaries of the most noteworthy changes made in each release.

Bug tracker

If you have any suggestions, bug reports, or annoyances please report them to our issue tracker at https://github.com/clivern/rabbit/issues

Security Issues

If you discover a security vulnerability within Rabbit, please send an email to [email protected]

Contributing

We are an open source, community-driven project so please feel free to join us. see the contributing guidelines for more details.

License

© 2019, Clivern. Released under MIT License.

Rabbit is authored and maintained by @Clivern.

rabbit's People

Contributors

clivern avatar

Watchers

James Cloos avatar  avatar

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.