Files
duplicati/Installer/debian/docker-build-binary.sh
T
Kenneth Skovhede 56f70b62c9 Added scripts to build deb and rpm packages locally through Docker.
Changed Windows build to use a local virtual machine.
Updated installer build script to use the local builds instead of the AWS ones.
2017-01-14 12:10:55 +01:00

57 lines
1.5 KiB
Bash

#!/bin/bash
if [ ! -f "$1" ]; then
echo "Please provide the filename of an existing zip build as the first argument"
exit
fi
FILENAME=`basename $1`
DIRNAME=`echo "${FILENAME}" | cut -d "_" -f 1`
VERSION=`echo "${DIRNAME}" | cut -d "-" -f 2`
DATE_STAMP=`LANG=C date -R`
if [ -d "${DIRNAME}" ]; then
rm -rf "${DIRNAME}"
fi
unzip -d "${DIRNAME}" "$1"
for n in "../oem" "../../oem" "../../../oem"
do
if [ -d $n ]; then
echo "Installing OEM files"
cp -R $n "${DIRNAME}/webroot/"
fi
done
for n in "oem-app-name.txt" "oem-update-url.txt" "oem-update-key.txt" "oem-update-readme.txt" "oem-update-installid.txt"
do
for p in "../$n" "../../$n" "../../../$n"
do
if [ -f $p ]; then
echo "Installing OEM override file"
cp $p "${DIRNAME}"
fi
done
done
cp -R "debian" "${DIRNAME}"
cp "bin-rules.sh" "${DIRNAME}/debian/rules"
sed -e "s;%VERSION%;$VERSION;g" -e "s;%DATE%;$DATE_STAMP;g" "debian/changelog" > "${DIRNAME}/debian/changelog"
touch "${DIRNAME}/releasenotes.txt"
docker build -t "duplicati/debian-build:latest" - < Dockerfile.build
# Weirdness with time not being synced in Docker instance
sleep 5
docker run --workdir "/builddir/${DIRNAME}" --volume `pwd`:/builddir:rw "duplicati/debian-build:latest" dpkg-buildpackage
rm -rf "${DIRNAME}"
for filename in "duplicati_${VERSION}-1_amd64.changes" "duplicati_${VERSION}-1.dsc" "duplicati_${VERSION}-1.tar.gz"
do
if [ -f "${filename}" ]; then
rm "${filename}"
fi
done