Skip to content

Commit

Permalink
added makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioteula committed Oct 6, 2024
1 parent d72d924 commit 51c3294
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ARG UID="1000"
ARG GID="1000"

ENV PRE_COMMIT_HOME="/code/.cache/pre-commit"
ENV PRE_COMMIT_COLOR="always"

RUN groupadd --gid ${GID} user \
&& useradd --uid ${UID} --gid user --shell /bin/bash --create-home user
Expand Down
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export UID:=$(shell id -u)
export GID:=$(shell id -g)

setup:
@git config --unset-all core.hooksPath || true
@git config --local core.hooksPath .githooks

build:
@docker build --build-arg TAG="3.12" --build-arg UID="${UID}" --build-arg GID="${GID}" -t python-amazon-paapi .

test: build
@docker run --rm -u "${UID}:${GID}" -v "${PWD}:/code" python-amazon-paapi -c "python -m unittest"

lint: build
@docker run --rm -u "${UID}:${GID}" -v "${PWD}:/code" python-amazon-paapi -c "python -m pre_commit run -a"

pre-commit:
@./.githooks/pre-commit

0 comments on commit 51c3294

Please sign in to comment.