~ged/Assemblage

Small-parts CI/CD for everyone
~ged/Assemblage-Web

New hg repository added

1 year, 8 months ago
~ged/Assemblage

New ticket tracker added

3 years ago

#Assemblage

A continuous integration toolkit.

home : https://assembla.ge/

code : https://hg.sr.ht/~ged/assemblage

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

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

#Description

assemblage, noun:

  1. a collection of parts, as of machinery, put together to form a whole.
  2. the process of joining persons or things to form a whole.

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

The product or output from such a task in Assemblage is called an Assembly. Assemblage has three primary parts for manipulating Assemblies: the Assembly Server, Assembly Workers, and Publishers. Assembly Workers listen for events set to an Assembly Server by a Publisher, and run one or more Assembly Scripts to assemble their products.

Assembly Server
Aggregates and distributes events from repositories to workers to make one or more "assemblies".
Assembly Workers
Listens for events published by the assembly server, checks out a repository, and runs one or more assembly scripts in that repository.
Publisher
A client that sends events to the server from distributed version control repositories. Assemblage currently supports Mercurial and Git.
Event
Notification of some change in a repository, e.g., a commit.
Assembly
A product or collection of products built as a reaction to one or more events.
Assembly Script
A script that is executed when an event occurs in a repository, checked into the repository source in the `.assembly` directory (by default).

#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

#Usage

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

...

Now copy the Mercurial hook to the repository (or another directory) and hook it into the .hg/hgrc:

[hooks]
incoming.assemblage = mercurial-hook.rb
changegroup.assemblage = mercurial-hook.rb
commit.assemblage = mercurial-hook.rb
incoming.assemblage = mercurial-hook.rb
txnclose-bookmark.assemblage = mercurial-hook.rb
txnclose-phase.assemblage = mercurial-hook.rb
pushkey.assemblage = mercurial-hook.rb
tag.assemblage = mercurial-hook.rb

And finally, we'll combine all the parts into an assembly called project1-freebsd-tests that will run on a worker with the freebsd, ruby, and libpq tags for each commit to the repo at http://repo.example.com/project1:

user@example $ assemblage add -t freebsd,ruby,libpq \
  http://repo.example.com/project1

Now when commits arrive at our repo, it will send events to the assembly server, which will queue up an assembly. Because the worker we added has all of the required tags, it will:

  • get a notification of the commit
  • clone the repository checked out to that commit
  • look for an assembly script called commit in a directory called .assembly/ (by default)
  • if it finds one, it will run the script from the cloned repo
  • it will then send back any files contained in the .assembly/ subdirectory with the SHA of the commit (if it exists) along with the exit code of the script.

#Contributing

You can check out the current development source with Mercurial via Sourcehut. Or if you prefer Git, via its Github mirror.

After checking out the source, run:

$ rake setup

This task will install any missing dependencies and do any developer setup.

#Authors

#License

Copyright (c) 2018-2019, Michael Granger All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of the author/s, nor the names of the project's contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.