-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make one-liners for building&running tests
- Loading branch information
Showing
6 changed files
with
52 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
set -ex | ||
export DOCKER_IMG=redun_python_test:redun_python_test | ||
export DOCKER_CONTAINER_NAME=redun_python_test | ||
|
||
docker build . --tag $DOCKER_IMG >/dev/null | ||
|
||
( docker rm -f $DOCKER_CONTAINER_NAME || true ) 2>&1 >/dev/null | ||
|
||
docker run \ | ||
-u "$(id -u):$(id -g)" \ | ||
-it \ | ||
--rm \ | ||
--name $DOCKER_CONTAINER_NAME \ | ||
-e PGUSER=postgres -e PGPASSWORD=postgres \ | ||
-v "$PWD:/v" \ | ||
-w /v \ | ||
--net host \ | ||
--shm-size=4gb \ | ||
--memory 6gb \ | ||
--memory-swap 6gb \ | ||
$DOCKER_IMG \ | ||
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM python:3.10-bookworm | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man2 | ||
RUN apt-get update -y && apt-get install -y libpq-dev gcc graphviz graphviz-dev openjdk-17-jdk libpq-dev gcc postgresql-client-15 pre-commit | ||
RUN java --version | ||
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/ | ||
ENV REQUIRE_POSTGRES=1 | ||
|
||
# run containers with user with id 1000 | ||
RUN useradd -rm -d /home/debian -s /bin/bash -g root -G sudo -u 1000 debian | ||
USER debian | ||
WORKDIR /home/debian |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash -e | ||
time ./.run.docker.sh make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash -ex | ||
ARGS="$@" | ||
time ./.run.docker.sh bash -c "set -ex; export TEST_ARGS=\"$ARGS\"; make test-postgres" |