npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

roat

v1.1.11

Published

Continuous integration server

Downloads

6

Readme

Roat

Roat is an automation core, well suited for implementing a Continuous Integration server. Its primary focus is to trigger the running of scripts based on detecting pushes to source code repositories. There is also a web interface for inspecting the current state and manually triggering scripts.

Configuration

Roat will read configuration from config.json by default, or the filename specified with the --config command line argument if present. For a complete example configuration file, please refer to example.config.json.

The configuration is a dictionary ({}) split into the following sections:

http

The application listens to http connections on the specified port and binds to the specified address:

"http": {
    "port": 9999,
    "bind": "127.0.0.1"
}

The defaults are 0 (automatic assignment) for port and 0.0.0.0 (listen to connections from all source addresses) for bind.

It is also possible to specify these options on the command line with the --port and --bind command line arguments.

actions

The scripts the Roat server runs are specified as actions in the config:

"actions": {
    <action-id>: <action-spec>,
    <action-id>: <action-spec>,
    ...
}

The <action-id> is used to refer to a specific action by other subsystems.

<action-spec> has a human readable title, a command line specified as a list in cmd, optionally the desired working directory as cwd and optionally necessary environmental variables in env:

"ls-color": {
    "title": "List files",
    "cmd": [ "ls", "-lhaG" ],
    "cwd": "/root",
    "env": {
        "CLICOLOR_FORCE": "true"
    }
}

Normally, an action will execute in a new subprocess every time it is triggered. Alternative running modes exist and are specified in the "mode" field, for example:

{
    ...
    "mode": "exclusive"
}

Available modes are:

  • immediate: The default. Start a new subprocess immediately, every time the action is triggered.
  • exclusive: When the action is triggered, Roat will kill currently running instances before starting a new subprocess.
  • queue: Run at most one instance of this action at a time, but wait for any currently running process to finish instead of killing it.

github

Roat listens for github WebHook messages on its /github URL.

The github subsystem triggers actions based on which repository was updated:

"github": {
    <repository-URL>: <action-ids>,
    <repository-URL>: <action-ids>,
    ...
}

For example:

"github": {
    "https://github.com/octokitty/testing": "ls-color",
    "https://github.com/octokitty/schmesting": [ "ls-color", "ls" ]
}

Note that you are required to use the full URL, with the https scheme and no trailing slash.

bitbucket

Roat listens for bitbucket's POST Service messages on its /bitbucket URL.

The bitbucket subsystem triggers actions based on which repository was updated:

"bitbucket": {
    <repository-URL>: <action-ids>,
    <repository-URL>: <action-ids>,
    ...
}

For example:

"bitbucket": {
    "/jespern/bitbucket/": "ls-color",
    "/jespern/git-7/": [ "ls-color", "ls" ]
}

Note that you are required to use only the path-part of the URL, including a trailing slash. The format is /<username>/<repository-name>/.

autostart

Roat will trigger the configured actions automatically on start:

"autostart": [
    <action-id>,
    <action-id>,
    ...
]

For example:

"autostart": [
    "ls-color"
]

In order to be kind to the host machine, it starts the configured services one at a time, separated by one second in time.

log

Roat will direct log output to the transports specified under this key:

"log": [
    <transport>,
    <transport>,
    ...
]

For example:

"log": [
    {
        "transport": "console"
    }, {
        "transport": "syslog"
    }
]

Roat uses logginator for logging and log target configuration. For further details about this config, please consult the logginator documentation.

Running

When you have configured roat, you can run

npm start

It will output something like:

12:30:34.566 2013-05-27 Monday
12:30:34.570 [roat] Version 1.1.3 (on node v0.10.7)
12:30:34.583 [roat, http] Listening on 127.0.0.1:9999

Visit the specified address in a web browser (http://127.0.0.1:9999) to inspect the current system status.

Add a WebHook URL to your repositories in github to allow Roat to react to pushes to github. The POST from github must reach the /github endpoint of Roat to allow this to work.

Happy automation!


Development of Roat is lovingly sponsored by BRIK Videobase AS in Bergen, Norway.