Skip to content

Commit 7bb489c

Browse files
committed
ensure mitmdump executable is accesible
1 parent 397ae62 commit 7bb489c

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

circleci/images/failtester/Dockerfile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,23 @@ ENV PATH=/usr/lib/postgresql/$PG_MAJOR/bin/:$PATH
8181
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
8282

8383
COPY ./files/etc/requirements.txt /tmp/etc/
84-
RUN pip3 install -Ir /tmp/etc/requirements.txt
84+
RUN <<EOF
85+
set -eux
86+
87+
pip3 install -Ir /tmp/etc/requirements.txt
88+
89+
MITMDUMP_BIN="$(python3 -c 'import sysconfig, pathlib; print(pathlib.Path(sysconfig.get_path("scripts")) / "mitmdump")')"
90+
91+
if [ ! -x "$MITMDUMP_BIN" ]; then
92+
echo "mitmdump executable not found at $MITMDUMP_BIN" >&2
93+
exit 1
94+
fi
95+
96+
if [ "$MITMDUMP_BIN" != "/usr/local/bin/mitmdump" ]; then
97+
ln -sf "$MITMDUMP_BIN" /usr/local/bin/mitmdump
98+
fi
99+
100+
hash mitmdump
101+
EOF
85102

86103
WORKDIR /home/circleci

0 commit comments

Comments
 (0)