Configure a simple http server to serve the pre compiled wheels

This commit is contained in:
Adrien Ferrand 2020-06-10 12:10:51 +02:00
parent f20b883a71
commit df0ccd200d
8 changed files with 12 additions and 7 deletions

View file

@ -26,11 +26,15 @@ source "${DIR}/common.sh"
RegisterQemuHandlers
ResolveArch "${SNAP_ARCH}"
docker run --net=host -d --rm -v "${DIR}/packages:/data/packages" --name pypiserver pypiserver/pypiserver
tools/strip_hashes.py letsencrypt-auto-source/pieces/dependency-requirements.txt > snap-constraints.txt
pushd "${DIR}/packages"
"${CERTBOT_DIR}/tools/simple_http_server.py" 8080 >/dev/null 2>&1 &
HTTP_SERVER_PID="$!"
popd
function cleanup() {
docker rm --force pypiserver
kill "${HTTP_SERVER_PID}"
}
trap cleanup EXIT
@ -40,7 +44,7 @@ docker run \
--net=host \
-v "${CERTBOT_DIR}:/certbot" \
-w "/certbot" \
-e "PIP_EXTRA_INDEX_URL=http://localhost:8080/simple" \
-e "PIP_EXTRA_INDEX_URL=http://localhost:8080" \
"adferrand/snapcraft:${DOCKER_ARCH}-stable" \
snapcraft

View file

@ -32,9 +32,10 @@ for SNAP_ARCH in ${TARGET_ARCHS}; do
&& python3 -m venv /build/venv \
&& /build/venv/bin/pip install wheel \
&& /build/venv/bin/pip wheel cryptography cffi -c snap-constraints.txt -w /build \
&& mkdir -p /workspace/packages \
&& mv /build/cryptography* /build/cffi* /workspace/packages \
&& chmod 775 /workspace/packages \
&& chmod 664 /workspace/packages/*
&& mkdir -p /workspace/packages/cffi /workspace/packages/cryptography \
&& mv /build/cryptography-* /workspace/packages/cryptography \
&& mv /build/cffi-* /workspace/packages/cffi \
&& chmod 775 /workspace/packages /workspace/packages/cffi /workspace/packages/cryptography \
&& chmod 664 /workspace/packages/cffi/* /workspace/packages/cryptography/*
"
done