Skip to content

Commit d93f4e3

Browse files
committed
updated Dockerfile to retry installing the cli version due to slow test pypi propagation
1 parent 20342bf commit d93f4e3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ ARG PIP_EXTRA_INDEX_URL=https://pypi.org/simple
88
RUN apk update \
99
&& apk add --no-cache git nodejs npm yarn
1010

11-
# Install CLI and optionally override SDK version
12-
RUN pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketsecurity==$CLI_VERSION \
13-
&& if [ ! -z "$SDK_VERSION" ]; then \
14-
pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socket-sdk-python==${SDK_VERSION}; \
11+
# Install CLI with retries for TestPyPI propagation (10 attempts, 30s each = 5 minutes total)
12+
RUN for i in $(seq 1 10); do \
13+
echo "Attempt $i/10: Installing socketsecurity==$CLI_VERSION"; \
14+
if pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketsecurity==$CLI_VERSION; then \
15+
break; \
16+
fi; \
17+
echo "Install failed, waiting 30s before retry..."; \
18+
sleep 30; \
19+
done && \
20+
if [ ! -z "$SDK_VERSION" ]; then \
21+
pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socket-sdk-python==${SDK_VERSION}; \
1522
fi

0 commit comments

Comments
 (0)