update docker / makefile

This commit is contained in:
André Roth
2024-03-06 12:46:44 +01:00
parent e564b7c150
commit 50eaf6c0bb
3 changed files with 19 additions and 8 deletions
+11 -6
View File
@@ -13,6 +13,11 @@ COVERAGE_DIR?=$(shell mktemp -d)
all: modules test bench check system-test
# Self-documenting Makefile
# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## Print this help
@grep -E '^[a-zA-Z][a-zA-Z0-9_-]*:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
prepare:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.51.2
@@ -78,19 +83,19 @@ release: goxc
mkdir -p build/
mv xc-out/$(VERSION)/aptly_$(VERSION)_* build/
man:
man: ## Create man pages
make -C man
version:
version: ## Print aptly version
@echo $(VERSION)
docker-build:
docker-build-system-tests: ## Build system-test docker image
docker build -f system/Dockerfile . -t aptly-system-test
docker-system-tests:
docker-system-tests: ## Run system tests in docker container
docker run -t --rm -v ${PWD}:/app aptly-system-test
golangci-lint:
golangci-lint: ## Run golangci-line in docker container
docker run -t --rm -v ~/.cache/golangci-lint/v1.56.2:/root/.cache -v ${PWD}:/app -w /app golangci/golangci-lint:v1.56.2 golangci-lint run
.PHONY: man modules version release goxc docker-build docker-system-tests
.PHONY: help man modules version release goxc docker-build docker-system-tests
+4 -1
View File
@@ -4,7 +4,7 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends curl gnupg &
RUN echo deb http://deb.debian.org/debian bookworm-backports main > /etc/apt/sources.list.d/backports.list
RUN apt-get update && \
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 && \
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 python3-venv && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN useradd -m --shell /bin/sh --home-dir /var/lib/aptly aptly
@@ -12,4 +12,7 @@ RUN useradd -m --shell /bin/sh --home-dir /var/lib/aptly aptly
RUN mkdir app
WORKDIR /app
RUN su - aptly -c "git clone https://github.com/aptly-dev/aptly-fixture-db.git"
RUN su - aptly -c "git clone https://github.com/aptly-dev/aptly-fixture-pool.git"
CMD /app/system/run-system-tests
+4 -1
View File
@@ -10,4 +10,7 @@ chown -R `stat -c %u /app` /var/lib/aptly
mkdir -p /home/runner
chown -R `stat -c %u /app` /home/runner
exec su - aptly -c "cd /app; go mod tidy; HOME=/home/runner make system-test"
su - aptly -c "cd /app; python3 -m venv system/env"
su - aptly -c "cd /app; go mod tidy; HOME=/home/runner make system-test"
rm -rf system/env