|
|
|
@ -5,17 +5,16 @@ VERSION=17.03
|
|
|
|
|
GREEN='\033[0;32m'
|
|
|
|
|
NC='\033[0m' # No Color]]'
|
|
|
|
|
|
|
|
|
|
# TODO optional clean
|
|
|
|
|
# rm -rf ejbuild
|
|
|
|
|
|
|
|
|
|
#echo -e "${GREEN}Pulling ejabberd build Docker image${NC}"
|
|
|
|
|
#docker pull ejabberd/mix assume we build it ourself until latest image is uploaded
|
|
|
|
|
docker images | grep -q "ejabberd/mix" || {
|
|
|
|
|
echo -e "${GREEN}Pulling ejabberd build Docker image${NC}"
|
|
|
|
|
docker pull ejabberd/mix
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo -e "${GREEN}Cloning ejabberd${NC}"
|
|
|
|
|
if [ ! -d ejbuild ]; then
|
|
|
|
|
git clone https://github.com/processone/ejabberd.git ejbuild
|
|
|
|
|
fi
|
|
|
|
|
(cd ejbuild; git checkout $VERSION)
|
|
|
|
|
(cd ejbuild; git checkout master && git pull && git checkout $VERSION)
|
|
|
|
|
cat > ejbuild/vars.config <<EOF
|
|
|
|
|
{mysql, true}.
|
|
|
|
|
{pgsql, true}.
|
|
|
|
@ -30,7 +29,7 @@ echo -e "${GREEN}Building ejabberd release${NC}"
|
|
|
|
|
if [ ! -e ejabberd.tar.gz ]; then
|
|
|
|
|
# Copy release configuration
|
|
|
|
|
cp rel/*.exs ejbuild/rel/
|
|
|
|
|
# Force clock resync ? why ?
|
|
|
|
|
# Force clock resync ?
|
|
|
|
|
#docker run -it --rm --privileged --entrypoint="/sbin/hwclock" ejabberd/mix -s
|
|
|
|
|
# Build ejabberd and generate release
|
|
|
|
|
docker run -it -v $(pwd)/ejbuild:$(pwd)/ejbuild -w $(pwd)/ejbuild -e "MIX_ENV=prod" ejabberd/mix do deps.get, deps.compile, compile, release --env=prod
|
|
|
|
|