|
| 1 | +#! /bin/bash |
| 2 | + |
| 3 | +_HOME2_=$(dirname $0) |
| 4 | +export _HOME2_ |
| 5 | +_HOME_=$(cd $_HOME2_;pwd) |
| 6 | +export _HOME_ |
| 7 | + |
| 8 | +echo $_HOME_ |
| 9 | +cd $_HOME_ |
| 10 | + |
| 11 | + |
| 12 | +if [ "$1""x" == "buildx" ]; then |
| 13 | + cp -a ../buildscripts . |
| 14 | + docker build -f Dockerfile -t qtox_push_002 . |
| 15 | + exit 0 |
| 16 | +fi |
| 17 | + |
| 18 | +cp -a ../.ci-scripts/build-qtox-linux.sh . |
| 19 | + |
| 20 | +build_for=' |
| 21 | +ubuntu:18.04 |
| 22 | +' |
| 23 | + |
| 24 | +for system_to_build_for in $build_for ; do |
| 25 | + |
| 26 | + system_to_build_for_orig="$system_to_build_for" |
| 27 | + system_to_build_for=$(echo "$system_to_build_for_orig" 2>/dev/null|tr ':' '_' 2>/dev/null) |
| 28 | + |
| 29 | + cd $_HOME_/ |
| 30 | + mkdir -p $_HOME_/"$system_to_build_for"/ |
| 31 | + |
| 32 | + mkdir -p $_HOME_/"$system_to_build_for"/artefacts |
| 33 | + mkdir -p $_HOME_/"$system_to_build_for"/script |
| 34 | + mkdir -p $_HOME_/"$system_to_build_for"/workspace |
| 35 | + |
| 36 | + ls -al $_HOME_/"$system_to_build_for"/ |
| 37 | + |
| 38 | + rsync -a ../ --exclude=.localrun $_HOME_/"$system_to_build_for"/workspace/build |
| 39 | + chmod a+rwx -R $_HOME_/"$system_to_build_for"/workspace/build |
| 40 | + |
| 41 | + echo '#! /bin/bash |
| 42 | +
|
| 43 | +cp -av /workspace/build/* /qtox/ |
| 44 | +cp -av /workspace/build/.??* /qtox/ |
| 45 | +cd /qtox/.ci-scripts/ |
| 46 | +
|
| 47 | +# disable tests |
| 48 | +sed -i -e "s#^include(Testing)##" /qtox/CMakeLists.txt |
| 49 | +cat /qtox/CMakeLists.txt|grep -i test |
| 50 | +
|
| 51 | +./build-qtox-linux.sh --sanitize --full --build-type Release |
| 52 | +
|
| 53 | +ls -hal /qtox/.ci-scripts/qtox |
| 54 | +
|
| 55 | +cp -av /qtox/.ci-scripts/qtox /artefacts/ |
| 56 | +cp -av /usr/lib/x86_64-linux-gnu/libsnore* /artefacts/ |
| 57 | +cp -av /usr/local/lib/libtoxcore* /artefacts/ |
| 58 | +
|
| 59 | +chmod a+rwx /artefacts/* |
| 60 | +
|
| 61 | +' > $_HOME_/"$system_to_build_for"/script/run.sh |
| 62 | + |
| 63 | + docker run -ti --rm \ |
| 64 | + -v $_HOME_/"$system_to_build_for"/artefacts:/artefacts \ |
| 65 | + -v $_HOME_/"$system_to_build_for"/script:/script \ |
| 66 | + -v $_HOME_/"$system_to_build_for"/workspace:/workspace \ |
| 67 | + --net=host \ |
| 68 | + "qtox_push_002" \ |
| 69 | + /bin/sh -c "apk add bash >/dev/null 2>/dev/null; /bin/bash /script/run.sh" |
| 70 | + if [ $? -ne 0 ]; then |
| 71 | + echo "** ERROR **:$system_to_build_for_orig" |
| 72 | + exit 1 |
| 73 | + else |
| 74 | + echo "--SUCCESS--:$system_to_build_for_orig" |
| 75 | + fi |
| 76 | + |
| 77 | +done |
| 78 | + |
| 79 | + |
0 commit comments