From 52bf714e38c9427b906d8bfe151bd7f9d4f66c3a Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Sat, 20 Apr 2024 20:31:19 -0300 Subject: [PATCH] Fix usage with docker and Firebird core GH Actions workflow. --- Dockerfile | 16 +++++++++++----- docker/setup.sh | 5 +++-- run-docker.sh | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9361e457..ed19fd66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN \ libtommath1 \ python3 \ python3-pip \ + python3-venv \ sudo && \ \ rm -rf /var/lib/apt/lists/* && \ @@ -17,10 +18,10 @@ RUN \ ARG UID=1000 -COPY setup.cfg pyproject.toml /qa-run/ +COPY pyproject.toml /qa-run/ RUN \ - useradd -u $UID user -G sudo && \ + useradd -m -u $UID user -G sudo && \ groupadd firebird && \ useradd --non-unique -M -b /opt -s /sbin/nologin -g firebird -u $UID firebird && \ usermod -G sudo firebird && \ @@ -30,12 +31,17 @@ RUN \ chown -R user:user /qa-out && \ chown -R firebird:firebird /qa-run && \ cd /qa-run && \ - pip install -e . && \ - pip install pytest-md-report pytest-timeout + ln -s /qa-out out && \ + python3 -m pip install pipx USER user -ENV PATH=/opt/firebird/bin:$PATH +RUN \ + cd /qa-run && \ + pipx ensurepath && \ + pipx install --preinstall pytest-md-report --preinstall pytest-timeout --include-deps firebird-qa + +ENV PATH=/opt/firebird/bin:/home/user/.local/bin:$PATH ENV TERMINFO_DIRS=/lib/terminfo ENV LD_LIBRARY_PATH=/opt/firebird/lib diff --git a/docker/setup.sh b/docker/setup.sh index 7261fd4b..5e1041ce 100755 --- a/docker/setup.sh +++ b/docker/setup.sh @@ -1,5 +1,6 @@ -#!/bin/sh +#!/bin/bash set -e +shopt -s extglob mkdir /tmp/firebird-installer cd /tmp/firebird-installer @@ -68,4 +69,4 @@ rm -r /tmp/firebird-installer mkdir /opt/firebird/examples/empbuild/qa chmod -R 777 /opt/firebird/examples/empbuild -cp -rn /qa/* /qa-run/ +cp -rn /qa/!(out) /qa-run/ diff --git a/run-docker.sh b/run-docker.sh index 5d5322c3..5f62a367 100755 --- a/run-docker.sh +++ b/run-docker.sh @@ -22,4 +22,4 @@ fi docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) --progress=plain -t firebird-qa $THIS_DIR mkdir -p $FBQA_OUT/tests -docker run --user $(id -u) --rm -v `realpath $FBQA_OUT`:/qa-out -v `realpath $FBQA_OUT/tests`:/qa-run/out/tests -v `realpath $THIS_DIR`:/qa -v `realpath $FBQA_INSTALLER`:/firebird-installer.tar.gz firebird-qa "$@" +docker run --user $(id -u) --rm -v `realpath $FBQA_OUT`:/qa-out -v `realpath $THIS_DIR`:/qa -v `realpath $FBQA_INSTALLER`:/firebird-installer.tar.gz firebird-qa "$@"