Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ birdwatcher-*
DIST/

*.local.*
debug.test
debug.test

# Debian package build outputs
birdwatcher_*_amd64.deb
birdwatcher_*_amd64.buildinfo
birdwatcher_*_amd64.changes
noble/dist/
14 changes: 14 additions & 0 deletions Makefile.packaging
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
build-image:
docker compose build
.PHONY: build-image

noble: build-image
docker compose run --rm noble
mkdir -p noble/dist
mv birdwatcher_*_amd64.deb noble/dist/
.PHONY: noble

clean:
rm -f birdwatcher_*_amd64.deb birdwatcher_*_amd64.buildinfo birdwatcher_*_amd64.changes
rm -rf noble/dist
.PHONY: clean
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ Our version also has a few more capabilities, as you will
discover when looking at [the modules section](https://github.com/alice-lg/birdwatcher/blob/master/etc/birdwatcher/birdwatcher.conf)
of the config.

## Debian package (Noble)

Build a `.deb` for Ubuntu 24.04 using Docker (same pattern as `bird-debian` / `frr_exporter-debian`):

```bash
make -f Makefile.packaging noble
```

The package installs `/usr/sbin/birdwatcher`. Chef still manages systemd units via the l3mpls cookbook.

## Installation

You will need to have go installed to build the package.
Expand Down
6 changes: 6 additions & 0 deletions build-debian-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash -ex

cd "$(dirname "$0")"
debuild -us -uc -b
# debuild writes artifacts one directory above the source tree; keep them in-repo.
mv ../birdwatcher_*_amd64.deb ../birdwatcher_*_amd64.buildinfo ../birdwatcher_*_amd64.changes . 2>/dev/null || true
3 changes: 3 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
birdwatcher.debhelper.log
birdwatcher.substvars
files
11 changes: 11 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
birdwatcher (2.2.2-1ubuntu1) noble; urgency=medium

* Build birdwatcher for Ubuntu 24.04 (Noble).

-- CNS-VPC-GATEWAYS <cns-vpc-gateways@digitalocean.com> Thu, 28 May 2026 14:00:00 +0000

birdwatcher (2.2.2-1ubuntu3) jammy; urgency=medium

* Jammy speaker build (historical reference).

-- CNS-VPC-GATEWAYS <cns-vpc-gateways@digitalocean.com> Tue, 31 Jan 2023 16:00:00 +0000
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
12 changes: 12 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Source: birdwatcher
Maintainer: CNS-VPC-GATEWAYS <cns-vpc-gateways@digitalocean.com>
Section: net
Priority: optional
Standards-Version: 3.9.5
Build-Depends: debhelper (>= 9), golang-go (>= 2:1.13~)

Package: birdwatcher
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
Description: JSON API service for alice-lg.
Birdwatcher exposes BIRD routing state over HTTP for monitoring and tooling.
15 changes: 15 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: birdwatcher
Source: https://github.com/alice-lg/birdwatcher

Files: *
Copyright: 2016 Alice LG contributors
License: GPL-3.0+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

Files: debian/*
Copyright: 2026 DigitalOcean, LLC
License: GPL-3.0+
1 change: 1 addition & 0 deletions debian/install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
birdwatcher usr/sbin/
6 changes: 6 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
set -e

# System user for the birdwatcher service when run outside Chef-managed units.
(id birdwatcher >/dev/null 2>&1) ||
adduser --system --group --no-create-home --home /nonexistent birdwatcher
11 changes: 11 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/make -f

%:
dh $@

# Build the Go binary; modules are fetched during the docker build.
override_dh_auto_build:
GO111MODULE=on GOARCH=amd64 GOOS=linux go build -o birdwatcher .

override_dh_auto_test:
@echo "Skipping tests during package build"
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
x-mount: &mount
volumes:
- .:/code
working_dir: /code

x-env: &env
environment:
DEBFULLNAME: ${DEBFULLNAME:-CNS-VPC-GATEWAYS}
DEBEMAIL: ${DEBEMAIL:-cns-vpc-gateways@digitalocean.com}

services:
noble:
image: birdwatcher-noble
build:
context: noble
<<: [*mount, *env]
entrypoint: ./build-debian-package.sh
platform: linux/amd64
11 changes: 11 additions & 0 deletions noble/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install --yes \
devscripts \
debhelper \
golang-go \
build-essential \
git && \
rm -rf /var/lib/apt/lists/*