diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-06-27 16:21:55 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-06-27 16:21:55 -0700 |
commit | 0588589d5728fd76e9c9ef7ba251f5f724536e70 (patch) | |
tree | 35fbf21b94b4b3bda09141dd1f47993d6e3a62ca | |
parent | 4d30f60bbea724028932b1ec1a7e8e9e9e08b3c7 (diff) | |
download | infinitytier-0588589d5728fd76e9c9ef7ba251f5f724536e70.tar.gz infinitytier-0588589d5728fd76e9c9ef7ba251f5f724536e70.zip |
.
-rwxr-xr-x | linux-build-farm/build.sh | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/linux-build-farm/build.sh b/linux-build-farm/build.sh index b6f593b4..f2d13154 100755 --- a/linux-build-farm/build.sh +++ b/linux-build-farm/build.sh @@ -2,9 +2,9 @@ export PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin -if [ $# = 0 ]; then - echo 'Usage: ./build.sh <distribution-name> [<distribution-name>] ...' - exit 1 +subdirs=$* +if [ ! -n "$subdirs" ]; then + subdirs=`find . -type d -name '*-*' -printf '%f '` fi if [ ! -d ./ubuntu-trusty ]; then @@ -20,10 +20,12 @@ cd linux-build-farm # Note that --privileged is used so we can bind mount VM shares when building in a VM. # It has no other impact or purpose, but probably doesn't matter here in any case. -for distro in $*; do - cd $distro +for distro in $subdirs; do + echo + echo "--- BUILDING FOR $distro ---" + echo - rm -f *.deb + cd $distro cd x64 mv ../../zt1-src.tar.gz . @@ -31,15 +33,21 @@ for distro in $*; do mv zt1-src.tar.gz ../.. cd .. -# docker run --rm -v `pwd`:/artifacts --privileged -it zt1-build-${distro}-x64 /bin/bash -c 'cd /ZeroTierOne ; make debian ; cd .. ; cp *.deb /artifacts ; ls -l /artifacts' - cd x86 mv ../../zt1-src.tar.gz . docker build -t zt1-build-${distro}-x86 . mv zt1-src.tar.gz ../.. cd .. -# docker run --rm -v `pwd`:/artifacts --privileged -it zt1-build-${distro}-x86 /bin/bash -c 'cd /ZeroTierOne ; make debian ; cd .. ; cp *.deb /artifacts ; ls -l /artifacts' + rm -f *.deb *.rpm + + if [ -e "`echo $distro | grep -F debian`" -a -e "`echo $distro | grep -F ubuntu`" ]; then + docker run --rm -v `pwd`:/artifacts --privileged -it zt1-build-${distro}-x64 /bin/bash -c 'cd /ZeroTierOne ; make redhat ; cd .. ; cp `find /root/rpmbuild -type f -name *.rpm` /artifacts ; ls -l /artifacts' + docker run --rm -v `pwd`:/artifacts --privileged -it zt1-build-${distro}-x86 /bin/bash -c 'cd /ZeroTierOne ; make redhat ; cd .. ; cp `find /root/rpmbuild -type f -name *.rpm` /artifacts ; ls -l /artifacts' + else + docker run --rm -v `pwd`:/artifacts --privileged -it zt1-build-${distro}-x64 /bin/bash -c 'cd /ZeroTierOne ; make debian ; cd .. ; cp *.deb /artifacts ; ls -l /artifacts' + docker run --rm -v `pwd`:/artifacts --privileged -it zt1-build-${distro}-x86 /bin/bash -c 'cd /ZeroTierOne ; make debian ; cd .. ; cp *.deb /artifacts ; ls -l /artifacts' + fi cd .. done |