# HG changeset patch
# Node ID 4c4090a149fd67045ea4c217b46b9be30b1a5357
# Parent  4e78a8475ee46b486ee30c2cb852a4fb5d12d39b
diff --git a/containers/Dockerfile.debian-trixie-amd64 b/containers/Dockerfile.debian-trixie-amd64
new file mode 100644
--- /dev/null
+++ b/containers/Dockerfile.debian-trixie-amd64
@@ -0,0 +1,28 @@
+FROM docker.io/debian:trixie-slim
+
+RUN set -ex && \
+    apt-get update && \
+    apt-get install -y --no-install-recommends \
+        build-essential \
+        ca-certificates \
+        gettext \
+        git \
+        gobject-introspection \
+        libgirepository1.0-dev \
+        libglib2.0-dev \
+        libtemplate-glib-1.0-dev \
+        mercurial \
+        meson \
+        python3-jinja2 \
+        python3-packaging \
+        python3-pygments \
+        python3-toml \
+        python3-typogrify \
+        zip \
+    && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists
+
+COPY meson-build.sh /build.sh
+
+CMD ["/build.sh"]
diff --git a/containers/Dockerfile.fedora-41-amd64 b/containers/Dockerfile.fedora-41-amd64
new file mode 100644
--- /dev/null
+++ b/containers/Dockerfile.fedora-41-amd64
@@ -0,0 +1,22 @@
+FROM docker.io/fedora:41
+
+RUN set -ex && \
+    dnf update -y && \
+    dnf install -y \
+        gcc \
+        gettext \
+        gi-docgen \
+        git \
+        glib2-devel \
+        gobject-introspection-devel \
+        mercurial \
+        meson \
+        ninja-build \
+        template-glib-devel \
+    && \
+    dnf clean all -y
+
+CMD ["/build.sh"]
+
+COPY meson-build.sh /build.sh
+
diff --git a/containers/convey.yaml b/containers/convey.yaml
new file mode 100644
--- /dev/null
+++ b/containers/convey.yaml
@@ -0,0 +1,68 @@
+---
+environment:
+  - REPO=rwgrim/traversity-builders
+  - REGISTRY=docker.io
+  - REGISTRY_USERNAME
+  - REGISTRY_PASSWORD
+tasks:
+  build:
+    type: docker/build
+    dockerfile: Dockerfile.${TARGET}
+    tag: ${REGISTRY}/${REPO}:${TARGET}
+    files: .:.
+    labels:
+      - COMMIT=${HG_COMMIT}
+
+  clean:
+    type: docker/remove
+    quiet: true
+    images:
+      - ${REGISTRY}/${REPO}/${TARGET}
+
+  import:
+    type: docker/import
+    files:
+      - .:.
+
+  login:
+    type: docker/login
+    username: ${REGISTRY_USERNAME}
+    password: ${REGISTRY_PASSWORD}
+    server: ${REGISTRY}
+
+  logout:
+    type: docker/logout
+    server: ${REGISTRY}
+
+  publish:
+    type: docker/push
+    image: ${REGISTRY}/${REPO}:${TARGET}
+
+plans:
+  clean:
+    stages:
+      - tasks: clean
+
+  build:
+    stages:
+      - tasks: [import, build]
+
+  publish:
+    environment: [REGISTRY_USERNAME, REGISTRY_PASSWORD]
+    stages:
+      - tasks: [login, publish]
+      - tasks: [logout]
+        run: always
+
+  debian-trixie-amd64:
+    environment:
+      - TARGET=debian-trixie-amd64
+    stages:
+      - tasks: [import, build]
+
+  fedora-41-amd64:
+    environment:
+      - TARGET=fedora-41-amd64
+    stages:
+      - tasks: [import, build]
+
diff --git a/containers/meson-build.sh b/containers/meson-build.sh
new file mode 100755
--- /dev/null
+++ b/containers/meson-build.sh
@@ -0,0 +1,9 @@
+#!/bin/sh -ex
+
+cd ${CONVEY_WORKSPACE}
+
+BUILD_DIR=${TARGET:-_build}
+
+meson setup ${MESON_OPTIONS} "${BUILD_DIR}"
+meson compile -C "${BUILD_DIR}"
+meson test --verbose -C "${BUILD_DIR}"
diff --git a/convey.yaml b/convey.yaml
new file mode 100644
--- /dev/null
+++ b/convey.yaml
@@ -0,0 +1,82 @@
+environment:
+  - BUILD_NUMBER
+  - REPOSITORY=rwgrim/traversity-builders
+  - REGISTRY=docker.io
+  - REGISTRY_USERNAME
+  - REGISTRY_PASSWORD
+  - DOCS_BUILD_IMAGE=${REGISTRY}/${REPOSITORY}:debian-trixie-amd64
+
+tasks:
+  clean:
+    type: convey/clean
+    files:
+      - debian-trixie-amd64
+      - fedora-41-amd64
+
+  import:
+    type: docker/import
+    files: .:.
+
+  build:
+    type: docker/run
+    image: ${REGISTRY}/${REPOSITORY}:${TARGET}
+
+  export:
+    type: docker/export
+    files: ${TARGET}
+
+  login:
+    type: docker/login
+    server: ${REGISTRY}
+    username: ${REGISTRY_USERNAME}
+    password: ${REGISTRY_PASSWORD}
+
+  logout:
+    type: docker/logout
+    server: ${REGISTRY}
+
+  docs-clean:
+    type: convey/clean
+    files:
+      - traversity-docs.zip
+  docs-build:
+    type: docker/run
+    image: ${DOCS_BUILD_IMAGE}
+    workdir: ${CONVEY_WORKSPACE}
+    script:
+      - set -ex
+      - rm -rf build-docs
+      - meson setup build-docs -Ddoc=true
+      - ninja -C build-docs doc
+      - cd build-docs/traversity/reference
+      - zip -9r traversity-docs.zip traversity
+  docs-export:
+    type: docker/export
+    files:
+      - build-docs/traversity/reference/traversity-docs.zip:traversity-docs.zip
+
+plans:
+  clean:
+    stages:
+      - tasks:
+          - clean
+          - docs-clean
+
+  debian-trixie-amd64:
+    environment: TARGET=debian-trixie-amd64
+    stages:
+      - tasks: [import, build]
+      - tasks: [export]
+        run: always
+
+  docs:
+    stages:
+      - tasks: [docs-clean, import, docs-build, docs-export]
+
+  fedora-41-amd64:
+    environment: TARGET=fedora-41-amd64
+    stages:
+      - tasks: [import, build]
+      - tasks: [export]
+        run: always
+
diff --git a/meson.build b/meson.build
--- a/meson.build
+++ b/meson.build
@@ -102,6 +102,7 @@
 
 gidocgen = find_program('gi-docgen', required : get_option('doc'))
 docs_dir = get_option('prefix') / get_option('datadir') / 'doc'
+doc_targets = []
 
 ###############################################################################
 # Subdirectories
@@ -110,5 +111,19 @@
 subdir('traversity')
 subdir('traversity-test')
 
+###############################################################################
+# Custom Targets
+###############################################################################
+if meson.backend() == 'ninja'
+  run_target('turtles',
+    command : ['ninja', '-C', '@BUILD_ROOT@', 'traversity-pot', 'all', 'test'])
+endif
+
+# This needs to be after all of the sub-directories have been processed.
+if get_option('doc')
+  alias_target('doc', doc_targets)
+endif
+
+
 # Output our configuration file.
 configure_file(output : 'config.h', configuration : conf)
diff --git a/traversity/reference/meson.build b/traversity/reference/meson.build
--- a/traversity/reference/meson.build
+++ b/traversity/reference/meson.build
@@ -28,4 +28,6 @@
 		install : true,
 		install_dir : docs_dir,
 	)
+
+	doc_targets += traversity_doc
 endif
