Matrix build script improvements

This commit is contained in:
Gitouche 2022-03-05 00:07:37 +01:00
parent 278c11f121
commit 82ad64bdde

View file

@ -10,14 +10,12 @@ ensure_not_root
if ! podman image exists localhost/matrixdotorg/synapse:${synapse_version}; then if ! podman image exists localhost/matrixdotorg/synapse:${synapse_version}; then
mkdir synapse && mkdir synapse &&
curl -s -- "https://codeload.github.com/matrix-org/synapse/tar.gz/refs/tags/${synapse_version}" | tar xz --strip-components 1 -C synapse/ && { curl -s -- "https://codeload.github.com/matrix-org/synapse/tar.gz/refs/tags/${synapse_version}" | tar xz --strip-components 1 -C synapse/ && {
podman pull docker.io/python:3.9-slim &&
podman pull docker.io/moby/buildkit:latest &&
podman run -d --name buildkitd --privileged docker.io/moby/buildkit:latest && podman run -d --name buildkitd --privileged docker.io/moby/buildkit:latest &&
curl -sSLf https://github.com/moby/buildkit/releases/download/v0.9.3/buildkit-v0.9.3.linux-amd64.tar.gz | tar xz -C ~/ bin/buildctl && curl -sSLf https://github.com/moby/buildkit/releases/download/v0.9.3/buildkit-v0.9.3.linux-amd64.tar.gz | tar xz -C ~/ bin/buildctl &&
~/bin/buildctl --addr=podman-container://buildkitd build --frontend dockerfile.v0 --local context=synapse/ --local dockerfile=synapse/docker/ --output type=tar | podman import - localhost/matrixdotorg/synapse:${synapse_version} ~/bin/buildctl --addr=podman-container://buildkitd build --frontend dockerfile.v0 --local context=synapse/ --local dockerfile=synapse/docker/ --output type=tar | podman import - localhost/matrixdotorg/synapse:${synapse_version}
podman rm --force buildkitd && podman rm --force buildkitd &&
podman rmi docker.io/moby/buildkit:latest && podman rmi docker.io/moby/buildkit:latest &&
rm -f bin/buildctl rm -f ~/bin/buildctl
} }
rm -rf synapse rm -rf synapse
fi fi