summaryrefslogtreecommitdiff
path: root/build/build.sh
blob: 1f9fa9aae073eb54f4fc543fcfeaf78ff734d1f3 (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
28
29
30
31
32
33
#!/bin/sh

INSPIRCD_VERSION=2.0.18
URL="https://github.com/inspircd/inspircd/archive/v${INSPIRCD_VERSION}.tar.gz"

cd "$( dirname "$0" )"

# Build build environment
echo "Building inspircd-build image."
docker build -t "inspircd-build" .

# Get source
if [ ! -d "inspircd-${INSPIRCD_VERSION}" ]; then
    echo "Downloading InspIRCd"
    wget $URL
    tar xzf "v${INSPIRCD_VERSION}.tar.gz"
fi

rm -rf ../inspircd && mkdir ../inspircd

# Start build environment
echo "Starting build..."
docker run \
    -v $(pwd)/inspircd-${INSPIRCD_VERSION}:/inspircd-build \
    -v $(pwd)/../inspircd:/inspircd \
    inspircd-build \
    /build-inner.sh

echo "\n***********************************************************************"
echo "Build Complete!"
echo "You may now build the inspircd image moving to the root of the"
echo "repository and runng  and running:\n"
echo "  docker build -t inspircd .\n"