Repo contains dockerfiles and required scripts to automate your opensource Qt app CI. Nowdays Qt folks making it harder to use their builds of Qt toolchain, but it's still possible, so hopefully this repo will help you as much as it helps me.
It's not updating frequently (usually only minor releases) and probably will not fit your advanced needs, but will show a way to organize your automation. If you want to help with changes - you are always welcome.
host$ git clone https://github.com/ACCOUNT/PROJECT.git
desktop:
host$ docker run -it --rm --volume="${PWD}/PROJECT:/home/user/project:ro" rabits/qt:5.14-desktop
android:
host$ docker run -it --rm --volume="${PWD}/PROJECT:/home/user/project:ro" rabits/qt:5.14-android
docker$ sudo apt update; sudo DEBIAN_FRONTEND=noninteractive apt install -y gnupg2
docker$ curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
docker$ echo 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' | sudo tee /etc/apt/sources.list.d/llvm-10.list
docker$ sudo apt update ; sudo apt install -y clang-format-10
docker$ mkdir -p build && cd build
desktop:
docker$ cmake ../project -G Ninja "-DCMAKE_PREFIX_PATH:PATH=${QT_DESKTOP}"
android (MultiABI):
docker$ cmake ../project -G Ninja -DCMAKE_BUILD_TYPE:STRING=Release -DANDROID_ABI:STRING=armeabi-v7a -DANDROID_BUILD_ABI_arm64-v8a:BOOL=ON -DANDROID_BUILD_ABI_x86:BOOL=ON -DANDROID_BUILD_ABI_x86_64:BOOL=ON "-DANDROID_NATIVE_API_LEVEL:STRING=${ANDROID_NATIVE_API_LEVEL}" "-DANDROID_SDK:PATH=${ANDROID_SDK_ROOT}" "-DANDROID_NDK:PATH=${ANDROID_NDK_ROOT}" "-DCMAKE_PREFIX_PATH:PATH=${QT_ANDROID}" "-DCMAKE_FIND_ROOT_PATH:STRING=${QT_ANDROID}" "-DCMAKE_TOOLCHAIN_FILE:PATH=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake"
docker$ cmake --build .
Qt changed their policy - and requires to enter the login/password during the installation. To securely pass those creds you can use the next way:
secrets.env file (you should already have the Qt account):
export QT_CI_LOGIN='YOUR_EMAIL'
export QT_CI_PASSWORD='YOUR_PASSWORD'
$ python3 -m http.server 8765
$ curl http://0.0.0.0:8765/secrets.env
$ cd 5.14-android
$ docker build --pull --rm=true --build-arg 'QT_CI_ENV_URL=http://172.17.0.1:8765/secrets.env' -t YOUR_LOGIN/qt:$(basename "${PWD}") .
Used extract-qt script from https://github.com/benlau/qtci/blob/master/bin/extract-qt-installer
Content type
Image
Digest
Size
1.7 GB
Last updated
over 5 years ago
docker pull rabits/qt:5.14-android