aboutsummaryrefslogtreecommitdiffstats
path: root/abuild
blob: f8e0c84bf1c2b26865569d31bc305f1c0510c815 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

set -e

## debug
if [ "$DOCKER_ABUILD_DEBUG" = "true" ]; then
  set -x
  PS4='$LINENO: '
fi

if [ "${PWD%aports/*}" = "$PWD" ]; then
  echo "Error: expecting to be run from within an aports/ tree!"
  echo "Could not find 'aports/' in the current path ($PWD)"
  exit 1
fi

DOCKER_VOLUMES="
    -v $PWD:/cwd
    -v ${HOME}/.abuild:/home/builder/.abuild
    -v ${HOME}/.abuild/.cache:/var/cache/apk
    -v ${HOME}/.abuild/.distfiles:/var/cache/distfiles
    -v ${PWD%aports/*}aports:/home/builder/aports
    -v ${PWD%aports/*}packages:/home/builder/packages
"

DOCKER="docker run -ti $DOCKER_VOLUMES -e DOCKER_ABUILD_DEBUG mor1/abuild"
$DOCKER "$@"