Blame docker/run.sh

10e43d
#!/bin/bash
10e43d
e7b20d
SCRIPT_DIR=$(cd `dirname "$0"`; pwd)
10e43d
BASE_DIR=`dirname "$SCRIPT_DIR"`
10e43d
DATA_DIR="$BASE_DIR/docker-builder-data"
10e43d
cc5124
BUILD_DIR=${DATA_DIR}/build
10e43d
dd482a
CONFIG_FILE="$BASE_DIR/config.sh"
dd482a
PACKET_BUILD_DIR="$BUILD_DIR/packet"
dd482a
SCRIPT_BUILD_DIR="$BUILD_DIR/script"
dd482a
if [ -f $CONFIG_FILE ]; then
dd482a
	source $CONFIG_FILE
dd482a
fi
dd482a
export PACKET_BUILD_DIR
dd482a
mkdir -p $PACKET_BUILD_DIR
dd482a
cc5124
if [ -z "${IMAGE}" ];then
afefb6
    export IMAGE=build-fedora-cross-win
cc5124
fi
cc5124
cc5124
if [ -z "$TASK" ];then
cc5124
    export TASK=synfig-win
cc5124
fi
cc5124
cc5124
if [ -z "$ARCH" ];then
cc5124
    export ARCH=64
cc5124
fi
cc5124
cc5124
cc5124
cc5124
export INSTANCE="build-${TASK}-${ARCH}"
cc5124
cc5124
# TODO: Automatically build image if not found
cc5124
cc5124
docker stop "${INSTANCE}" || true
cc5124
docker rm "${INSTANCE}" || true
cc5124
e71c94
10e43d
docker run -it \
cc5124
    --name "${INSTANCE}" \
b0fa99
    --privileged=true \
cc5124
    $DOCKER_RUN_OPTIONS \
cc5124
    -v "${PACKET_BUILD_DIR}:/build/packet" \
cc5124
    -v "${SCRIPT_BUILD_DIR}:/build/script" \
26f5ff
    -e ARCH \
26f5ff
    -e PLATFORM \
cc5124
    morevna/${IMAGE} \
cc5124
    "$@"