Commit 3deeb3bd authored by Carlo Landmeter's avatar Carlo Landmeter
Browse files

dabuild: refactor volumes

- printf -v is not posix
- check for abuild.conf instead of alpine-release
- check if distfiles is writable
- do not mount /var/cache/apk as this will break apkindex
- do not create volumes from makefile
parent 089bc9fb
......@@ -36,7 +36,6 @@ build-%:
# engine, DOCKER_BUILDKIT appears to have some strange behaviour so turning
# it off for now
DOCKER_BUILDKIT=0 docker build $$DOCKER_FLAGS -t $(IMG):$* .
for v in $(VOLS) ; do docker volume create abuild-$*-$${v//\//_} ; done
$(RM) Dockerfile
.PHONY: push
......
......@@ -58,17 +58,16 @@ if [ ! \( -d "$ABUILD_PACKAGES" -a -w "$ABUILD_PACKAGES" \) ]; then
fi
## setup volumes; use named volumes as cache if desired
printf -v ABUILD_VOLUMES "%s "\
"-v ${HOME}/.abuild:/home/builder/.abuild" \
"-v ${PWD%/aports*}/aports:/home/builder/aports" \
"-v ${ABUILD_PACKAGES}:/home/builder/packages"
if [ -s "/etc/alpine-release" ]; then
printf -v ABUILD_VOLUMES "%s "\
$ABUILD_VOLUMES \
"-v /etc/abuild.conf:/etc/abuild.conf"\
"-v /var/cache/distfiles:/var/cache/distfiles"\
"-v /var/cache/apk:/var/cache/apk"
ABUILD_VOLUMES="-v ${HOME}/.abuild:/home/builder/.abuild \
-v ${PWD%/aports*}/aports:/home/builder/aports \
-v ${ABUILD_PACKAGES}:/home/builder/packages"
if [ -f "/etc/abuild.conf" ]; then
ABUILD_VOLUMES="$ABUILD_VOLUMES -v /etc/abuild.conf:/etc/abuild.conf"
fi
if [ -w "/var/cache/distfiles" ]; then
ABUILD_VOLUMES="$ABUILD_VOLUMES -v /var/cache/distfiles:/var/cache/distfiles"
fi
if [ "$DABUILD_CACHE" = "true" ]; then
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment