Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ged/assemblage

Git mirror of the Assemblage continuous integration toolkit
https://github.com/ged/assemblage

continuous-integration distributed git mercurial ruby

Last synced: 10 days ago
JSON representation

Git mirror of the Assemblage continuous integration toolkit

Awesome Lists containing this project

README

        

# Assemblage

A continuous integration toolkit.

home
: https://assembla.ge/

code
: https://bitbucket.org/sascrotch/assemblage

github
: https://github.com/ged/assemblage

docs
: http://assembla.ge/docs/assemblage

## Description

Assemblage is a continuous integration library. It's intended to provide you
with a minimal toolkit for distributing and performing automated tasks
for one or more version control repositories. It makes as few assumptions as
possible as to what those tasks might be.

A task in Assemblage is called an Assembly. Assemblage has three primary parts for manipulating Assemblies: the **Assembly Server**, **Assembly
Workers**, and **Repositories**.


Assembly Server

Aggregates and distributes events from repositories to
workers via one or more "assemblies".

Assembly Workers

Listens for events published by the assembly server, checks out
a repository, and runs an assembly script in that repository.

Repository

A distributed version control repository. Assemblage currently supports
Mercurial and Git.

## Prerequisites

* Ruby
* libzmq >= 4.2.3 (with drafts enabled)
* czmq >= 4.1.0 (with drafts enabled)
* A DVCS; Assemblage currently supports Mercurial and Git.

## Installation

This example uses three different hosts for the three parts, but you can, of
course, run all of this on a single host.

You'll first need a server to manage your assemblies:

example $ sudo gem install assemblage
example $ assemblage create server /usr/local/assemblage
Creating a server run directory in /usr/local/assemblage...
Generating a server key...
Creating the assemblies database...
done.

You can start the assembly server like so:
assemblage -c /usr/local/assemblage/config.yml start server

Server public key is:
&}T0.[{MZSJC]roN-{]x2QCkG+dXki!6j!.1JU1u

example $ assemblage -c /usr/local/assemblage/config.yml start server
Starting assembly server at:
tcp://example.com:7872

Now (possibly on a different host) you can create a new worker installation.
Workers have a name and a list of tags that describe its capabilities, e.g.,
the OS it's running on, installed software, etc. Our example is running on
FreeBSD 11, and has Ruby 2.4, Ruby 2.5, Python 2.7, ZeroMQ, and the PostgreSQL
client libraries available. We'll use a pretty simple tag convention but you
can make it as simple or complex as you want.

user@example-client $ sudo gem install assemblage
user@example-client $ mkdir -p /usr/local/assemblage
user@example-client $ cd /usr/local/assemblage
user@example-client $ assemblage create worker \
-t freebsd,freebsd11,ruby,ruby24,ruby25,python,python27,zeromq,libpq worker1
Creating a new assembly worker run directory in
/usr/local/assemblage/worker1...
Set up with worker name: example-client-worker1
Client public key is:
PJL=qK@SHy3#re-w@W)4C]Aj+aD}toGf*Y*SOOZ4
done.

Now we need to register the client with the server. On the server host:

user@example $ assemblage add worker example-client-worker1 \
"PJL=qK@SHy3#re-w@W)4C]Aj+aD}toGf*Y*SOOZ4"
Approving connections from example-client-worker1...
done.

Now go back to the worker and tell it that it should talk to the new server we
just set up:

user@example-client $ cd /usr/local/assemblage/worker1
user@example-client $ assemblage add server \
tcp://example.com:7872 "&}T0.[{MZSJC]roN-{]x2QCkG+dXki!6j!.1JU1u"
Talking to tcp://example.com:7872...
Testing registration... success.
done.

Now you can start the worker, which will listen for jobs it can work on.

user@example-client $ cd /usr/local/assemblage/worker1
user@example-client $ assemblage start worker
Starting assembly worker `worker1`...
Connecting to assembly servers...
example... done.
Waiting for jobs...

Now we need our repositories to notify the assembly server when events occur.
We'll hook up a Mercurial repo for a Ruby library so that it runs unit tests
whenever there's a new commit. First we'll install assemblage on the repo
server and create a run directory for repo operations:

user@example-repo $ sudo gem install assemblage hglib
user@example-repo $ mkdir /usr/local/hg/repos/.assemblage
user@example-repo $ cd /usr/local/hg/repos/.assemblage
user@example-repo $ assemblage create repo project1
Creating a new assemblage repo run directory in
/usr/local/hg/repos/.assemblage...
Set up with repo name: project1
Client public key is:
bq9VheQbLtcu]LGK4I&xzK3^UW0Iyak/6