From a31aa3d1007f3f47b538a275e2845a462d00a430 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 14 Nov 2018 13:37:51 +0100 Subject: [PATCH] gitlab-ci: run `fdroid build` on new buildserver runner --- .gitlab-ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c0b99d75d2..1105751240 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,14 +1,13 @@ image: registry.gitlab.com/fdroid/ci-images-server:latest -before_script: - - rm -rf fdroidserver - - mkdir fdroidserver - - curl --silent https://gitlab.com/fdroid/fdroidserver/repository/master/archive.tar.gz - | tar -xz --directory=fdroidserver --strip-components=1 - - export PATH="$PWD/fdroidserver:$PATH" - - touch config.py - lint: + before_script: + - rm -rf fdroidserver + - mkdir fdroidserver + - curl --silent https://gitlab.com/fdroid/fdroidserver/repository/master/archive.tar.gz + | tar -xz --directory=fdroidserver --strip-components=1 + - export PATH="$PWD/fdroidserver:$PATH" + - touch config.py script: # if this is a merge request fork, then only check relevant apps - if [ "$CI_PROJECT_NAMESPACE" != "fdroid" ]; then @@ -55,3 +54,40 @@ pages: - rm -rf public - gem install git_stats - git_stats generate --silent --out-path=public + +fdroid-buildserver: + tags: + - fdroid + - buildserver + artifacts: + name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}" + paths: + - logs + - unsigned + expire_in: 1 week + when: always + script: + - virsh -c qemu:///system destroy builder_default || true + - virsh -c qemu:///system undefine builder_default + --nvram --managed-save --remove-all-storage --snapshots-metadata || true + - git -C /home/fdroid/fdroidserver reset --hard + - git -C /home/fdroid/fdroidserver checkout -B master origin/master + - export PATH="$HOME/fdroidserver:$PATH" + - git fetch https://gitlab.com/fdroid/fdroiddata.git + - test -d build || mkdir build + - for f in `git diff --name-only --diff-filter=d FETCH_HEAD...HEAD`; do + appid=`echo $f | sed -n -e 's,^metadata/\([^/][^/]*\)\.txt,\1,p' + -e 's,^metadata/\([^/][^/]*\)\.yml,\1,p'`; + ! test -z "$appid" || continue; + echo building $appid; + set -x; + if [ "$CI_PROJECT_NAMESPACE" = "fdroid" ]; then + fdroid build --verbose -Werror --server --stop --latest $appid; + else + fdroid build --verbose -Wwarn --server --stop --test --force --latest $appid; + fi; + set +x; + done + after_script: + - cd builder + - vagrant destroy --force