forked from steveyegge/gastown
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.e2e
More file actions
74 lines (63 loc) · 2.34 KB
/
Dockerfile.e2e
File metadata and controls
74 lines (63 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Dockerfile.e2e - Isolated environment for e2e testing
#
# This container provides full isolation for integration tests that require:
# - No interference from host tmux sessions
# - Clean filesystem without existing Gas Town installations
# - Independent beads daemon and Dolt server
#
# Usage:
# docker build -f Dockerfile.e2e -t gastown-test .
# docker run --rm gastown-test
FROM golang:1.26-alpine
ARG DOLT_VERSION=1.82.4
ARG BD_VERSION=v0.57.0
# Install dependencies including CGO build requirements for beads daemon
# procps and lsof are required by gt dolt start for process verification
RUN apk add --no-cache \
git \
bash \
sqlite \
build-base \
zstd-dev \
icu-dev \
procps \
lsof \
tmux
# Install beads daemon (bd)
RUN for i in 1 2 3; do \
go install github.com/steveyegge/beads/cmd/bd@${BD_VERSION} && break; \
if [ "$i" -eq 3 ]; then exit 1; fi; \
sleep 2; \
done
# Install Dolt (required for beads database server), pinned for stability
RUN for i in 1 2 3; do \
rm -rf /tmp/dolt && \
git clone --depth 1 --branch v${DOLT_VERSION} https://github.com/dolthub/dolt /tmp/dolt && \
cd /tmp/dolt/go && go install ./cmd/dolt && \
cd / && rm -rf /tmp/dolt && \
break; \
if [ "$i" -eq 3 ]; then exit 1; fi; \
sleep 2; \
done
# Configure git and dolt identity (required for gt install --git and dolt init)
RUN git config --global user.name "Test User" && \
git config --global user.email "test@test.com" && \
git config --global init.defaultBranch main && \
dolt config --global --add user.name "Test User" && \
dolt config --global --add user.email "test@test.com"
# Set up workspace
WORKDIR /app
# Copy go.mod and go.sum first for better layer caching
COPY go.mod go.sum ./
RUN for i in 1 2 3; do \
go mod download && break; \
if [ "$i" -eq 3 ]; then exit 1; fi; \
sleep 2; \
done
# Copy source code
COPY . .
# Build gt binary
RUN go build -ldflags "-X github.com/steveyegge/gastown/internal/cmd.BuiltProperly=1" -o /usr/local/bin/gt ./cmd/gt
# Run e2e tests (all TestInstall* functions from install_integration_test.go)
# Note: Using -count=1 to disable test caching, -parallel 1 for sequential execution
CMD ["go", "test", "-tags=e2e", "-timeout=5m", "-v", "-count=1", "-parallel", "1", "-run", "TestInstall", "./internal/cmd/..."]