You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Directory for to build the release into
|
|
|
|
mkdir -p release
|
|
|
|
|
|
|
|
# Clone fresh copy of picc
|
|
|
|
if [[ ! -d "picc" ]]; then
|
|
|
|
git clone http://git.raptorpond.com/picc/picc.git
|
|
|
|
else
|
|
|
|
echo "picc already cloned."
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd picc || exit
|
|
|
|
|
|
|
|
git pull
|
|
|
|
|
|
|
|
# Fetch rebar
|
|
|
|
if [[ ! -f "rebar3" ]]; then
|
|
|
|
curl -LO https://s3.amazonaws.com/rebar3/rebar3
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Build picc in a fresh alpine container and deposit the build into /release/
|
|
|
|
cat <<EOF | docker run --rm -i \
|
|
|
|
-v "$PWD"/picc:/picc \
|
|
|
|
-v "$PWD"/release:/release \
|
|
|
|
alpine:3.15 \
|
|
|
|
/bin/sh
|
|
|
|
apk update
|
|
|
|
apk add erlang-dev
|
|
|
|
cd /picc
|
|
|
|
./rebar3 as docker release -o ../release
|
|
|
|
EOF
|
|
|
|
|
|
|
|
docker build -t docker.raptorpond.com/picc .
|