Merge pull request #6183 from MRC3742/2.2
[opentx.git] / tools / release22 / build-release.sh
blobdd248b346ebb36d5d2a6b7f47877be6804bd1ede
1 #!/bin/bash
3 set -e
5 branch=2.2
6 docker=release22
7 workdir=/home/opentx/release22
8 output=/var/www/html/2.2/release
9 version=2.2.3
11 cd ${workdir}
13 # Create on-demand build environment
14 cp code/radio/util/Dockerfile .
15 docker build -t new-${docker} .
16 docker rmi -f ${docker} || true
17 docker tag new-${docker} ${docker}
18 docker rmi -f new-${docker}
20 # Call sdcard generation
21 code/tools/release22/build-sdcard.sh
23 # Build Linux companion
24 docker run -dit --name companion -v /home/opentx/${docker}:/opentx ${docker}
25 docker exec companion sh -c "mkdir -p build && cd build && cmake /opentx/code && cp radio/src/stamp.h /opentx/binaries/stamp-opentx.txt"
26 docker exec companion rm -rf build
27 if [ ! -f ${output}/companion/linux/companion22_${version}_amd64.deb ]; then
28 docker exec companion /opentx/code/tools/build-companion-release.sh /opentx/code /opentx/binaries/
29 docker exec companion sh -c "cp /build/radio/src/lua/*.txt /opentx/binaries"
30 cp -f binaries/*.deb ${output}/companion/linux/companion22_${version}_amd64.deb
31 cp -f binaries/lua_fields_*.txt ${output}/firmware
33 docker stop companion
34 docker rm companion
36 # Request companion compilation on Windows
37 if [ ! -f ${output}/companion/windows/companion-windows-${version}.exe ]; then
38 cd ${output}/companion/windows
39 wget -qO- http://winbox.open-tx.org/companion-builds/compile22.php?branch=${branch}
40 wget -O companion-windows-${version}.exe http://winbox.open-tx.org/companion-builds/companion-windows-${version}.exe
41 chmod -f g+w companion-windows-${version}.exe
44 # Request companion compilation on Mac OS X
45 if [ ! -f ${output}/companion/macosx/opentx-companion-${version}.dmg ]; then
46 cd ${output}/companion/macosx
47 wget -qO- http://opentx.blinkt.de:8080/~opentx/build-opentx.py?branch=${branch}
48 wget -O opentx-companion-${version}.dmg http://opentx.blinkt.de:8080/~opentx/builds/opentx-companion-${version}.dmg
49 chmod -f g+w opentx-companion-${version}.dmg
52 # Update stamps
53 cp -f $workdir/binaries/stamp-opentx.txt ${output}/firmware
54 echo "#define VERSION "'"2.2.3"' > ${output}/companion/companion-windows.stamp
55 cp -f ${output}/companion/companion-windows.stamp ${output}/companion/companion-macosx.stamp
56 cp -f ${output}/companion/companion-windows.stamp ${output}/companion/companion-linux.stamp
59 # Clean binaries It will be hosting built on demand firmware
60 rm -rf $workdir/binaries/*
61 rm -rf $workdir/binaries/.lock