Giter VIP home page Giter VIP logo

pieter-ci's Introduction

Rationale

This is Pieter, a bear (yes, a bear) and a super-lightweight CI.

One day you could realize that number of great tools doesn't fully suit simple idea: to provide lightweight private CI.

  • TeamCity and Jenkins are way too heavy
  • Travis not suitable when one needs privacy
  • Drone is container-oriented so sometimes an overhead
  • ...

There are many other solutions, but it was hard to find one good enough to rapidly deploy and use in a minute or two.

So meet the Pieter CI!

Pieter pronounces more like St. Petersburg in short form, not like a person's name.

Key concepts

  • Lightweight, daemon would never consume more than couple percents of your CPU
  • Compact, tool designed to solve one and only issue: executing predefined jobs on demand
  • Easy, absence of complex stuff and overmanagement makes deploy, learning and usage questions of minutes

Requirements

Installation

Some ways to run Pieter CI:

Containers

Easy way

Using docker-compose:

docker-compose up

Flexible way

Run as standalone containers isolated in private network:

docker network create pieter

docker run -d --name redis \
    -p 6379:6379 \
    --network pieter \
    -v $(pwd)/data:/data \
    redis

docker run -d --name pieter-ci \
    -p 8000:8000 \
    --network pieter \
    agrrh/pieter-ci:stable

Manual way

Run locally for test purposes, development or containers-free setup:

# First, run redis in your way of choice

source misc/local.env
./pieter

http http://127.0.0.1:8000/

All required libraries could be installed with:

pip3 install -r requirements.txt

Configuraion

You could customize env variables to configure the software, these are defaults:

PIETER_DB_HOST=redis
PIETER_DB_PORT=6379

Shows where to seek for DB.

PIETER_API_HOST=0.0.0.0
PIETER_API_PORT=8000

These options point API on which address/port to listen.

API examples

Those examples are using awesome httpie.

Repo lifecycle

Repository is an object you want to interact with.

This could be code repository to build application from or just a webpage to download on specific events.

List repositories

http GET http://0.0.0.0:8000/repos

Create repository

http PUT http://0.0.0.0:8000/repos/pieter [email protected]:agrrh/pieter-ci.git

Examine repo

http GET http://0.0.0.0:8000/repos/pieter

Remove repo

http DELETE http://0.0.0.0:8000/repos/pieter

Scenario lifecycle

Scenario is some item related to "build" object. Set of rules which would be applied to repository when requested.

Add scenario

http PUT http://0.0.0.0:8000/repos/pieter/build.sh < misc/test_script.sh

View scenario

http GET http://0.0.0.0:8000/repos/pieter/build.sh

Remove scenario

http DELETE http://0.0.0.0:8000/repos/pieter/build.sh

Job lifecycle

Run a job

http PATCH http://0.0.0.0:8000/repos/pieter/build.sh

Check job status

http GET http://0.0.0.0:8000/jobs/${JOB_ID}

Delete a job

http DELETE http://0.0.0.0:8000/jobs/${JOB_ID}

Credits

pieter-ci's People

Contributors

agrrh avatar

Watchers

 avatar

pieter-ci's Issues

Accept GitHub hooks

It should be possible to fire off a job on GitHub hook

Expected behavior:

  • Build separate API lever
  • Accept push event
  • Fire off a job
  • Differentiate GitHub/Gitlab/Gogs/Gitea hooks?

Master-workers model

Think of implementing master/workers model

Is it okay to implement such feature while saying this is a dead simple product focused on rapid installation and easy usage?

UI prototype

  • Create/delete repo
  • Add/delete scenarios
  • Run jobs
  • Check job result

PUT on scenario returns wrong code

201 code on update existing scenario:

>>> requests.put(API_URL + 'repos/automated_tests_repo/scenario1', data=data)
<Response [201]>
>>> requests.put(API_URL + 'repos/automated_tests_repo/scenario1', data=data)
<Response [201]>

Wrong, should be 200.

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.