Skip to content

Commit a69aa7c

Browse files
committed
system-tests: add Dockerfile
1 parent a71186b commit a69aa7c

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM debian:bookworm-slim
2+
3+
RUN apt-get update -y && apt-get install -y --no-install-recommends curl gnupg && apt-get clean && rm -rf /var/lib/apt/lists/*
4+
5+
RUN echo deb http://deb.debian.org/debian bookworm-backports main > /etc/apt/sources.list.d/backports.list
6+
RUN apt-get update && \
7+
apt-get install -y --no-install-recommends apg bzip2 xz-utils ca-certificates golang/bookworm-backports golang-go/bookworm-backports golang-doc/bookworm-backports golang-src/bookworm-backports make git python3 && \
8+
apt-get clean && rm -rf /var/lib/apt/lists/*
9+
10+
RUN useradd -m --shell /bin/sh --home-dir /var/lib/aptly aptly
11+
12+
RUN mkdir app
13+
WORKDIR /app
14+
15+
CMD /app/system/run-system-tests

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,10 @@ man:
8282
version:
8383
@echo $(VERSION)
8484

85-
.PHONY: man modules version release goxc
85+
docker-build:
86+
docker build -f system/Dockerfile --no-cache . -t aptly-system-test
87+
88+
docker-system-tests:
89+
docker run --rm -it -v ${PWD}:/app aptly-system-test
90+
91+
.PHONY: man modules version release goxc docker-build docker-system-tests

system/run-system-tests

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
rm -rf /tmp/aptly*
4+
rm -rf /home/test/.*
5+
rm -rf /home/test/aptly-fixture-*
6+
7+
usermod -u `stat -c %u /app` aptly
8+
chown -R `stat -c %u /app` /var/lib/aptly
9+
10+
mkdir -p /home/runner
11+
chown -R `stat -c %u /app` /home/runner
12+
13+
exec su - aptly -c "cd /app; go mod tidy; HOME=/home/runner make system-test"

0 commit comments

Comments
 (0)