From f984e85cd516612b03873fba2d0c2b8d2feb0de1 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 3 Aug 2022 11:58:49 -0700 Subject: [PATCH] gitlab-ci: keep transitional code in `fdroid build` job This transitional block of code for installing fdroid/sdkmanager needs to remain until the buildserver is upgraded to handle all that. The `fdroid build` is meant to provide a CI run as close as possible to the production buildserver. It should not include custom setup or methods, except when there is no other way to make this job work. Android's sdkmanager is definitely part of the buildserver setup, and is included in the fdroidserver:buildserver image. Also, `sdkmanager --licenses` is totally inappropriate for F-Droid, and also already handled by the buildserver provisioning. F-Droid only accepts the licenses that match free software source code. Google has separate licenses for libraries that have free source vs proprietary source. F-Droid will never accept the licenses that are tied to proprietary source. Also, the CI env var needs to remain set. Unsetting it here creates an custom, undocumented, brittle setup. This reverts !11367 !11476 and upgrades fdroid/sdkmanager to 0.6.1 --- .gitlab-ci.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b37aed3884..867d8ea79f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,18 +34,6 @@ variables: - echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8" | debconf-set-selections - apt-get install -qy --no-install-recommends fdroidserver apksigner mercurial git git-svn brz locales -.install_sdkmanager: &install_sdkmanager - - curl -Lo /tmp/cmdline-tools.zip -t 5 "https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_CMDLINE_TOOLS}_latest.zip" - - echo "${ANDROID_CMDLINE_TOOLS_SHA256} /tmp/cmdline-tools.zip" | sha256sum -c - - - unzip -q -o /tmp/cmdline-tools.zip -d /tmp/cmdline-tools - - mkdir -p ${ANDROID_HOME}/cmdline-tools/tools - - mv /tmp/cmdline-tools/cmdline-tools/* ${ANDROID_HOME}/cmdline-tools/tools - || true - - export PATH=${ANDROID_HOME}/cmdline-tools/tools/bin:${PATH} - - set +o pipefail - - yes | sdkmanager --licenses > /dev/null - - set -o pipefail - .get_target_source_refs: &get_target_source_refs - | if [ "$CI_PROJECT_PATH" = "fdroid/fdroiddata" ] && [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then @@ -271,6 +259,14 @@ checkupdates_runner: - echo "============== Summary =====================" - 'grep -v "INFO: Processing" /tmp/out || true' +# This job is should be as close as possible to the production +# buildserver. It should not include custom setup or methods, except +# when there is no other way to make this job work. The docker image +# is created using the same provisioning as the producion buildserver, +# via the "docker" job in fdroid/fdroidserver. +# +# This job is tied to the buildserver. Changes must be reviewed by +# the buildserver maintainers. fdroid build: stage: build needs: [] @@ -292,7 +288,6 @@ fdroid build: ANDROID_HOME: /opt/android-sdk ANDROID_SDK_ROOT: ${ANDROID_HOME} script: - - unset CI - test -d build || mkdir build - *get_changed_apps - test -n "$(printf "$CHANGED" | tr -d '[:space:]')" @@ -303,8 +298,12 @@ fdroid build: - test -n "$fdroidserver" || source /etc/profile.d/bsenv.sh - - *install_sdkmanager - + # TODO remove sdkmanager install once it is included in the buildserver image + - git clone --depth=1 --branch=0.6.1 https://gitlab.com/fdroid/sdkmanager.git + - git -C sdkmanager checkout -B master f7e1064a78462a74cfc4ce3b1214c29644e438d7 + - pip3 install -e sdkmanager + - rm -rf $ANDROID_HOME/tools # TODO remove once sdkmanager can upgrade installed packages + # These packages are needed to make this env like the production buildserver. - sdkmanager "tools" "platform-tools" "build-tools;31.0.0" - *install_fdroid_server