Skip to content
GitHub no longer supports this web browser. Learn more about the browsers we support.
A build system agnostic build monitor written in Rust
Rust Vue JavaScript Dockerfile Shell HTML CSS
Branch: master
Clone or download
Cannot retrieve the latest commit at this time.
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Push docker images to duckhq Jan 22, 2020
.vscode Show config in vscode Jan 22, 2020
media Rename res directory Jan 24, 2020
schemas Add GitHub Actions collector Feb 3, 2020
src Add support for "Queued" status Feb 4, 2020
web
.dockerignore Move frontend code Jan 22, 2020
.gitattributes Autogenerate JSON Schema from Rust code (#23) Jan 24, 2020
.gitignore Initial commit Jan 19, 2020
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Jan 20, 2020
Cargo.lock Add GitHub Actions collector Feb 3, 2020
Cargo.toml
Dockerfile Move frontend code Jan 22, 2020
LICENSE Add license Jan 19, 2020
README.md Add GitHub Actions to README Feb 3, 2020
build.sh Autogenerate JSON Schema from Rust code (#23) Jan 24, 2020

README.md

Duck

Duck is a build system agnostic build monitor written in Rust (backend server) and Vue (frontend). It also support sending messages to Slack and controlling Philips Hue lights.

The frontend

Table of Contents

  1. Getting started
  2. How it works
  3. Supported providers
  4. Configuration
  5. License

Getting started

The absolute easiest way of getting started with Duck is to use the docker image. You will have to provide a configuration file for it to work.

> docker run --rm -it -v ./data:/data -p 8080:15825 duckhq/duck:latest --config /data/duck.json

How it works

The server part is responsible for collecting information from different collectors and forward interesting events to observers. The aggregated information is available for other services (such as the Vue frontend) via a HTTP API.

Observers can either be dependent on events from all collectors, or opt in to one or more collectors. This makes it easy to setup team specific build lights or Slack integration that's only dependent on specific collectors.

Overview

Supported providers

Collectors

Collectors are responsible for collecting builds and deployments from other systems such as build servers.

Observers

Observers monitor builds and deployments and react to any changes that is made to their state.

Configuration

Example

Below is an example configuration that specifies multiple collectors and observers. By specifying the schema you will get autocomplete support in editors that support it like Visual Studio Code.

{
    "$schema": "https://raw.githubusercontent.com/spectresystems/duck/master/schemas/v0.6.json",
    "interval": 30,
    "collectors": [
        {
            "teamcity": {
                "id": "teamcity_internal",
                "serverUrl": "https://${TEAMCITY_HOST}:${TEAMCITY_PORT}/",
                "credentials": "guest",
                "builds": [
                    "My_Project_Definition",
                    "My_Other_Build_Definition"
                ]
            }
        },
        {
            "github": {
                "id": "github_pullrequests",
                "owner": "spectresystems",
                "repository": "duck",
                "workflow": "pull_request.yml",
                "credentials": {
                    "basic": {
                        "username": "patriksvensson",
                        "password": "hunter1!"
                    }
                }
            }
        },
        {
            "teamcity": {
                "id": "teamcity_local",
                "enabled": false,
                "serverUrl": "192.168.0.1:8111",
                "credentials": {
                    "basic": {
                        "username": "admin",
                        "password": "hunter1!"
                    }
                },
                "builds": [
                    "My_Third_Build_Definition"
                ]
            }
        },
        {
            "azure": {
                "id": "azure_cake",
                "enabled": false,
                "organization": "cake-build",
                "project": "Cake",
                "credentials": "anonymous",
                "definitions": [ "1", "3", "5" ],
                "branches": [
                    "refs/heads/develop",
                    "refs/heads/main"
                ]
            }
        },
        {
            "azure": {
                "id": "azure_private",
                "enabled": false,
                "organization": "some-organization",
                "project": "some-project",
                "credentials": {
                    "pat": "${AZURE_PAT}"
                },
                "definitions": [ "1" ],
                "branches": [
                    "refs/heads/master"
                ]
            }
        },
        {
            "octopus": {
                "id": "octopus_local",
                "serverUrl": "https://localhost:9000",
                "credentials": {
                    "apiKey": "${OCTOPUS_API_KEY}"
                },
                "projects": [
                    {
                        "projectId": "Project-1",
                        "environments": [
                            "Environment-1",
                            "Environment-2"
                        ]
                    }
                ]
            }
        }
    ],
    "observers": [
        {
            "hue": {
                "id": "hue_team_1_builds",
                "collectors": [
                    "teamcity_local"
                ],
                "hubUrl": "http://192.168.1.99",
                "username": "THE-HUE-USERNAME",
                "lights": [ "1" ]
            }
        },
        {
            "hue": {
                "id": "hue_all_builds_dimmed",
                "hubUrl": "http://192.168.1.99",
                "username": "THE-HUE-USERNAME",
                "brightness": 50,
                "lights": [ "2", "3" ]
            }
        },
        {
            "slack": {
                "id": "slack_team1",
                "collectors": [ "teamcity_local" ],
                "credentials": {
                    "webhook": {
                        "url": "https://hooks.slack.com/services/MY-WEBHOOK-URL"
                    }
                }
            }
        },
        {
            "mattermost": {
                "id": "mattermost",
                "channel": "build-status",
                "credentials": {
                    "webhook": {
                        "url": "https://mattermost.example.com"
                    }
                }
            }
        }
    ]
}

License

Copyright © Patrik Svensson and contributors.

Duck is provided as-is under the MIT license. For more information see LICENSE.

You can’t perform that action at this time.