Quick fix for broken builds due to out of date apt cache on Travis
[appimagekit/gsi.git] / travis / travis-build.sh
blob48fd9fc5ae3e1f6a106549e5b7c418e7da44024f
1 #! /bin/bash
3 set -e
4 set -x
6 case "$ARCH" in
7 "x86_64")
8 export ARCH="x86_64"
9 ;;
10 "i386"|"i686")
11 export ARCH="i686"
12 # sleep so as not to overwrite during uploading (FIXME)
13 sleep 60
15 esac
17 # clean up and download data from GitHub
18 rm -rf data.tar.g* .gnu* || true
19 wget https://github.com/AppImage/AppImageKit/files/584665/data.zip -O data.tar.gz.gpg
20 ( set +x ; echo $KEY | gpg2 --batch --passphrase-fd 0 --no-tty --skip-verify --output data.tar.gz --decrypt data.tar.gz.gpg ) || true
21 ( tar xf data.tar.gz ; sudo chown -R $USER .gnu* ; rm -rf $HOME/.gnu* ; mv .gnu* $HOME/ ) || true
23 # prepare output directory
24 mkdir -p ./out/
26 # build AppImageKit
27 docker run --rm \
28 --device /dev/fuse:mrw \
29 -e ARCH -e TRAVIS -e TRAVIS_BUILD_NUMBER \
30 -i \
31 -v "${PWD}":/AppImageKit \
32 -v "${PWD}"/travis/:/travis \
33 "$DOCKER_IMAGE" \
34 /bin/bash -x "/travis/build-binaries.sh" --run-tests
36 # inspect AppDirs
37 find build/out/appimagetool.AppDir/
38 find build/out/appimaged.AppDir/
40 # build AppImages
41 docker run --rm \
42 --cap-add SYS_ADMIN \
43 --device /dev/fuse:mrw \
44 -e ARCH -e TRAVIS -e TRAVIS_BUILD_NUMBER \
45 -i \
46 -v "${PWD}":/AppImageKit \
47 -v "${PWD}"/travis/:/travis \
48 -v $HOME/.gnupg:/root/.gnupg \
49 "$DOCKER_IMAGE" \
50 /bin/bash -x "/travis/build-packages-and-appimages.sh"
52 cd build/
54 # test AppImages
55 [ "$ARCH" == "i686" ] && sudo apt-get update && sudo apt-get install -y gcc-multilib lib32z1 libfuse2 libfuse2:i386 libglib2.0-0:i386 libcairo2:i386
56 bash -x ../travis/test-appimages.sh
58 # install more tools
59 # (vim-common contains xxd)
60 sudo apt-get install vim-common
62 # fix permissions
63 sudo chown -R travis.travis .
65 # remove binaries from output directory
66 ls -al out/
67 rm -r out/{appimaged,appimagetool,validate,digest,mksquashfs,*.AppDir}
69 # inspect runtime
70 xxd out/runtime | head -n 1
71 # fix filename for upload
72 mv out/runtime out/runtime-"$ARCH"
74 # remove unused files
75 sudo rm -rf out/*.AppDir out/*.AppImage.digest
77 # fix filename for upload
78 sudo mv out/AppRun out/AppRun-"$ARCH"