Skip to content

Commit

Permalink
Add git-debranch as a dev dependency, allow running in arena dev cont…
Browse files Browse the repository at this point in the history
…ainer (sartography#1652)
  • Loading branch information
jbirddog authored May 31, 2024
1 parent 4f9277a commit 283886c
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 6 deletions.
22 changes: 18 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
MY_USER := $(shell id -u)
MY_GROUP := $(shell id -g)
ME := $(MY_USER):$(MY_GROUP)
USER_ID ?= $(shell id -u)
USER_NAME ?= $(shell id -un)
GROUP_ID ?= $(shell id -g)
GROUP_NAME ?= $(shell id -gn)
ME ?= $(USER_ID):$(GROUP_ID)

SUDO ?= sudo

Expand Down Expand Up @@ -33,7 +35,12 @@ all: dev-env start-dev run-pyl
@true

build-images:
$(DOCKER_COMPOSE) build
$(DOCKER_COMPOSE) build \
--build-arg USER_ID=$(USER_ID) \
--build-arg USER_NAME=$(USER_NAME) \
--build-arg GROUP_ID=$(GROUP_ID) \
--build-arg GROUP_NAME=$(GROUP_NAME) \
$(JUST)

dev-env: stop-dev build-images poetry-i be-poetry-i be-db-clean fe-npm-i
@true
Expand Down Expand Up @@ -109,6 +116,12 @@ fe-sh:
fe-unimported:
$(IN_FRONTEND) npx unimported

git-debranch:
$(IN_ARENA) poetry run git-debranch

git-debranch-offline:
$(IN_ARENA) poetry run git-debranch --offline

poetry-i:
$(IN_ARENA) poetry install --no-root

Expand Down Expand Up @@ -137,5 +150,6 @@ take-ownership:
be-clear-log-file be-logs be-mypy be-poetry-i be-poetry-lock be-poetry-rm \
be-db-clean be-db-migrate be-sh be-sqlite be-tests be-tests-par \
fe-lint-fix fe-logs fe-npm-clean fe-npm-i fe-npm-rm fe-sh fe-unimported \
git-debranch git-debranch-offline \
poetry-i poetry-rm pre-commit ruff run-pyl \
take-ownership
10 changes: 9 additions & 1 deletion dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
FROM python:3.12.1-slim-bookworm

ARG USER_ID
ARG USER_NAME
ARG GROUP_ID
ARG GROUP_NAME

WORKDIR /app

RUN apt-get update \
&& apt-get install -y -q git-core curl \
&& apt-get install -y -q git-core curl vim-tiny \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN addgroup --gid $GROUP_ID $GROUP_NAME \
&& adduser --uid $USER_ID --gid $GROUP_ID $USER_NAME

RUN git config --global --add safe.directory /app

RUN pip install --upgrade pip
Expand Down
1 change: 1 addition & 0 deletions dev.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ services:
XDG_CACHE_HOME: "/app/.cache"
volumes:
- ./:/app
- ${MY_SSH_DIR:-/tmp/__spiff_nossh}:${MY_SSH_DIR:-/tmp/__spiff_nossh}
Loading

0 comments on commit 283886c

Please sign in to comment.