Fix doc path
[opentx.git] / tools / nightly22 / build-nightly.sh
blobb6ddc9893cf070cf22ddee880a9538fb603e411f
1 #!/bin/bash
3 set -e
5 branch=2.2
6 docker=nightly22
7 workdir=/home/opentx/nightly22
8 output=/var/www/html/2.2/nightlies
9 version=2.2.4
11 # Incrementnightly index
12 index=`cat index.txt`
13 index=`expr $index + 1`
14 suffix="N$index"
16 cd ${workdir}
18 #make sure there are no leftovers
19 rm -f ${workdir}/binaries/*.deb
20 rm -f ${output}/companion/linux/companion22_${version}${suffix}_amd64.deb
21 rm -f ${output}/companion/windows/companion-windows-${version}${suffix}.exe
22 rm -f ${output}/companion/macosx/opentx-companion-${version}${suffix}.dmg
24 # Create on-demand build environment
25 cp code/radio/util/Dockerfile .
26 docker build -t new-${docker} --build-arg OPENTX_VERSION_SUFFIX=${suffix} .
27 docker rmi -f ${docker} || true
28 docker tag new-${docker} ${docker}
29 docker rmi -f new-${docker}
31 # Call sdcard generation
32 code/tools/nightly22/build-sdcard.sh
34 # Build Linux companion
35 docker run -dit --name companion -v /home/opentx/${docker}:/opentx ${docker}
36 docker exec companion sh -c "mkdir -p build && cd build && cmake /opentx/code && cp radio/src/stamp.h /opentx/binaries/stamp-opentx.txt"
37 docker exec companion rm -rf build
38 if [ ! -f ${output}/companion/linux/companion22_${version}${suffix}_amd64.deb ]; then
39 docker exec companion /opentx/code/tools/build-companion-nightly.sh /opentx/code /opentx/binaries/ ${suffix}
40 cp -f binaries/*.deb ${output}/companion/linux/companion22_${version}${suffix}_amd64.deb
42 docker stop companion
43 docker rm companion
45 # Request companion compilation on Windows
46 if [ ! -f ${output}/companion/windows/companion-windows-${version}${suffix}.exe ]; then
47 cd ${output}/companion/windows
48 wget -qO- http://winbox.open-tx.org/companion-builds/compile22.php?branch=$branch\&suffix=${suffix}
49 wget -O companion-windows-${version}${suffix}.exe http://winbox.open-tx.org/companion-builds/companion-windows-${version}${suffix}.exe
50 chmod -Rf g+w companion-windows-${version}${suffix}.exe
54 # Request companion compilation on Mac OS X
55 if [ ! -f ${output}/companion/macosx/opentx-companion-${version}${suffix}.dmg ]; then
56 cd ${output}/companion/macosx
57 wget -qO- http://opentx.blinkt.de:8080/~opentx/build-opentx.py?branch=${branch}\&suffix=${suffix}
58 wget -O opentx-companion-${version}${suffix}.dmg http://opentx.blinkt.de:8080/~opentx/builds/opentx-companion-${version}${suffix}.dmg
59 chmod -Rf g+w opentx-companion-${version}${suffix}.dmg
62 # Update stamps
63 cp -f ${workdir}/binaries/stamp-opentx.txt ${output}/firmware
64 echo "#define VERSION \"${version}${suffix}\"" > ${output}/companion/companion-windows.stamp
65 cp -f ${output}/companion/companion-windows.stamp ${output}/companion/companion-linux.stamp
66 cp -f ${output}/companion/companion-windows.stamp ${output}/companion/companion-macosx.stamp
68 # Clean binaries It will be hosting built on demand firmware
69 rm -rf ${workdir}/binaries/*
70 rm -rf ${workdir}/binaries/.lock
72 # Released is considered as valid if we get to that point
73 echo $index > ${workdir}/index.txt