diff --git a/drydocker/docker/build.sh b/drydocker/docker/build.sh index 8106faa..9111e5e 100755 --- a/drydocker/docker/build.sh +++ b/drydocker/docker/build.sh @@ -1,22 +1,22 @@ #!/bin/bash -pushd /srv/docker.git/ci +pushd ${TMPDIR}/docker.git/ci # Require free disk space (>= 30%) df=$(sudo df /var/lib/docker/devicemapper 2>/dev/null | tail -n 1 | awk '{print $4/$2}') if [ -z "${df}" ]; then echo "Undetermined amount of free space, cleaning up in any case." make clean elif [ $( bc <<< "${df} <= 0.30" ) == 1 ]; then make clean df=$(sudo df /var/lib/docker/devicemapper 2>/dev/null | tail -n 1 | awk '{print $4/$2}') if [ $( bc <<< "$df <= 0.30" ) == 1 ]; then echo "Cannot get disk space consumption to under 70%" exit 1 fi fi make -B all || exit $? popd diff --git a/drydocker/stick/build.sh b/drydocker/stick/build.sh index 3fe318c..b76223f 100755 --- a/drydocker/stick/build.sh +++ b/drydocker/stick/build.sh @@ -1,23 +1,33 @@ #!/bin/bash md51=$(md5sum ${TMPDIR}/stick.git/drydocker.sh | awk '{print $1}') md52=$(md5sum /usr/local/bin/drydocker | awk '{print $1}') if [ "${md51}" != "${md52}" ]; then cp -f ${TMPDIR}/stick.git/drydocker.sh /usr/local/bin/drydocker chmod 755 /usr/local/bin/drydocker echo "Refreshed /usr/local/bin/drydocker" fi if [ ! -d "${TMPDIR}/docker.git" ]; then git clone https://git.kolab.org/diffusion/DO/docker.git ${TMPDIR}/docker.git else pushd ${TMPDIR}/docker.git git remote set-url origin https://git.kolab.org/diffusion/DO/docker.git git fetch origin git reset --hard origin/master git clean -d -f -x popd fi +if [ ! -d "${TMPDIR}/docker.git" ]; then + git clone https://git.kolab.org/diffusion/DO/docker.git ${TMPDIR}/docker.git +else + pushd ${TMPDIR}/docker.git + git remote set-url origin https://git.kolab.org/diffusion/DO/docker.git + git fetch origin + git reset --hard origin/master + git clean -d -f -x +fi + ${TMPDIR}/stick.git/drydocker/docker/build.sh