Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

Commit 9adbef6

Browse files
mairasclaude
andauthored
refactor: align build system with container-packaging-tools (#44)
Simplify the build system to match the cleaner pattern used in container-packaging-tools, eliminating sources of CI failures. Changes: - Replace Dockerfile.debtools with Dockerfile.devtools (Bookworm base, non-root user, system-wide uv installation) - Replace docker-compose.debtools.yml with docker-compose.devtools.yml (remove env_file dependency, simplify volume mounts) - Simplify run script: remove _env, _export_unset, dev-env functions that caused CI failures with .env file handling - Rename debtools to devtools for consistency - Add docker-shell and docker-clean commands - Fix package-name in workflow: halpi2-daemon → halpid to match debian/control The old build system had multiple failure modes: 1. env_file requiring .env to exist 2. grep failing on comment-only .env files 3. Complex volume mounting with DIR_NAME variable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent d4acf4a commit 9adbef6

6 files changed

Lines changed: 139 additions & 214 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
build-release:
99
uses: hatlabs/shared-workflows/.github/workflows/build-release.yml@main
1010
with:
11-
package-name: halpi2-daemon
11+
package-name: halpid
1212
package-description: 'HALPI2 hardware daemon (Python implementation)'
1313
apt-component: hatlabs
1414
runs-on: ubuntu-latest-arm64

docker/Dockerfile.debtools

Lines changed: 0 additions & 32 deletions
This file was deleted.

docker/Dockerfile.devtools

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Development environment for HALPI2-daemon
2+
#
3+
# Provides a Debian Bookworm environment with all development and build tools.
4+
# Used for testing, linting, and Debian package building.
5+
6+
FROM debian:bookworm
7+
8+
# Install system dependencies including Debian packaging tools
9+
RUN apt-get update && apt-get install -y \
10+
python3 \
11+
python3-pip \
12+
python3-venv \
13+
python3-dev \
14+
debhelper \
15+
dh-python \
16+
pybuild-plugin-pyproject \
17+
build-essential \
18+
fakeroot \
19+
devscripts \
20+
dpkg-dev \
21+
python3-all \
22+
python3-setuptools \
23+
curl \
24+
git \
25+
sudo \
26+
&& rm -rf /var/lib/apt/lists/*
27+
28+
# Create non-root user for development
29+
ARG USERNAME=builder
30+
ARG USER_UID=1000
31+
ARG USER_GID=$USER_UID
32+
33+
RUN groupadd --gid $USER_GID $USERNAME \
34+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
35+
&& echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME \
36+
&& chmod 0440 /etc/sudoers.d/$USERNAME
37+
38+
# Install uv system-wide
39+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
40+
&& mv /root/.local/bin/uv /usr/local/bin/uv \
41+
&& mv /root/.local/bin/uvx /usr/local/bin/uvx
42+
43+
# Set PATH for all users
44+
ENV PATH="/usr/local/bin:${PATH}"
45+
46+
# Switch to non-root user
47+
USER $USERNAME
48+
49+
# Set working directory
50+
WORKDIR /workspace
51+
52+
# Default command
53+
CMD ["/bin/bash"]

docker/docker-compose.debtools.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

docker/docker-compose.devtools.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
services:
2+
devtools:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile.devtools
6+
image: halpi2-daemon-devtools:latest
7+
8+
# Mount the project directory
9+
volumes:
10+
- ..:/workspace
11+
12+
# Working directory
13+
working_dir: /workspace
14+
15+
# Keep container running for interactive use
16+
stdin_open: true
17+
tty: true
18+
19+
# Run as non-root user
20+
user: builder
21+
22+
# Override command for interactive use
23+
command: /bin/bash

0 commit comments

Comments
 (0)