Vitaly Shaburov
#!/bin/bash
WORKDIR=/export/home/admin
WORKSPACE=${WORKDIR}/du2
JOBS=4
umask 022
export CCACHE_DISABLE="true"
echo '===================== ENVIRONMENT =================='
env
echo '===================== GET SOURCES =================='
test -L /etc/dpkg/origins/default || sudo ln -fs dilos /etc/dpkg/origins/dilos
test -f /usr/bin/gmake || sudo ln -fs make /usr/bin/gmake
git clone https://bitbucket.org/dilos/du2.git ${WORKSPACE}
echo '===================== GET PACKAGES =================='
cd ${WORKDIR}
export DEB_BUILD_OPTIONS="parallel= 2"
sudo -E apt-get update
sudo apt-get install -y acl iputils-ping kbd ksh scheduler system-data-console-fonts traceroute gmake build-essential
DEBIAN_FRONTEND=nkvmoninteractive sudo -E apt-get install -f -y
DEBIAN_FRONTEND=noninteractive sudo -E apt-get upgrade -y
if ! getent group shadow | grep -q '^shadow:[^:]*:42'; then
sudo -E groupadd -g 42 shadow
fi
sudo -E apt-get install -y libx11-6 libxi6 libxtst6
sudo -E /usr/bin/ln -fs libX11.so.6 /usr/lib/64/libX11.so.4
sudo -E /usr/bin/ln -fs libXi.so.6 /usr/lib/64/libXi.so.5
sudo -E /usr/bin/ln -fs libXtst.so.6 /usr/lib/64/libXtst.so.1
while read COMPONENT; do
if [[ "" == "$COMPONENT" ]]; then
continue
fi
echo '===================== BUILD ${COMPONENT} =================='
cd "${WORKSPACE}/components/${COMPONENT}"
sudo -E mkdir -p /data/repo/${COMPONENT}
BLD_COMPONENT=${COMPONENT}-$(date '+%Y-%m-%d')
BUILD_RESULT=/data/repo/${COMPONENT}
export COMPONENT_RESULT=`echo ${BLD_COMPONENT} | sed -e 's;/;-;'`
sudo -E /usr/bin/rm -rf ${BUILD_RESULT}/du/${COMPONENT_RESULT}
mkdir -p ${BUILD_RESULT}/du/${COMPONENT_RESULT} 2>/dev/null
sudo -E gmake JOBS=${JOBS} WS_DEBS=${BUILD_RESULT}/du/${COMPONENT_RESULT} deb
RES=$?
echo '===================== BUILD DEBCLOBBER =================='
sudo -E gmake debclobber
if (( $RES > 0 )); then
echo "===================== ERROR : ${RES} =================="
exit 1
fi
done < /data/repo/pkg/list_component
echo '===================== DONE =================='
EOT
{"serverDuration": 25, "requestCorrelationId": "d3c239403b1c43c9b62754f555742c96"}