CI: allow triggering these jobs from other projects

The end goal is running jobs in the "leaf" repositories (like this one)
automatically when a change to CzechLight/dependencies is enquequed.

Change-Id: Id389a3975e9d818939477adf15a6677c299dcdc4
diff --git a/.zuul.yaml b/.zuul.yaml
index 9fa6cf5..c89c897 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -1,3 +1,11 @@
+- job:
+    name: velia-f34-clang-asan-ubsan
+    parent: f34-clang-asan-ubsan
+    pre-run: ci/pre.yaml
+    requires: CzechLight-deps-f34-clang-asan-ubsan
+    vars:
+      zuul_work_dir: "{{ zuul.projects[zuul.project.canonical_hostname + '/CzechLight/velia'].src_dir }}"
+
 - project:
     check:
       jobs:
@@ -6,10 +14,8 @@
             required-projects: &projects
               - CzechLight/dependencies
             pre-run: ci/pre.yaml
-        - f34-clang-asan-ubsan:
-            requires: CzechLight-deps-f34-clang-asan-ubsan
+        - velia-f34-clang-asan-ubsan:
             required-projects: *projects
-            pre-run: ci/pre.yaml
         - f34-clang-tsan:
             requires: CzechLight-deps-f34-clang-tsan
             required-projects: *projects
diff --git a/ci/build.sh b/ci/build.sh
index 0edee7b..7cc580d 100755
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -5,9 +5,11 @@
 
 ZUUL_JOB_NAME=$(jq < ~/zuul-env.json -r '.job')
 ZUUL_TENANT=$(jq < ~/zuul-env.json -r '.tenant')
-ZUUL_PROJECT_SRC_DIR=$HOME/$(jq < ~/zuul-env.json -r '.project.src_dir')
-ZUUL_PROJECT_SHORT_NAME=$(jq < ~/zuul-env.json -r '.project.short_name')
+LEAF_PROJECT_NAME=CzechLight/velia
+ZUUL_PROJECT_SRC_DIR=$HOME/$(jq < ~/zuul-env.json -r ".projects[] | select(.name == \"${LEAF_PROJECT_NAME}\").src_dir")
+ZUUL_PROJECT_SHORT_NAME=$(jq < ~/zuul-env.json -r ".projects[] | select(.name == \"${LEAF_PROJECT_NAME}\").short_name")
 ZUUL_GERRIT_HOSTNAME=$(jq < ~/zuul-env.json -r '.project.canonical_hostname')
+ZUUL_JOB_NAME_NO_PROJECT=${ZUUL_JOB_NAME##${ZUUL_PROJECT_SHORT_NAME}-}
 
 CI_PARALLEL_JOBS=$(awk -vcpu=$(getconf _NPROCESSORS_ONLN) 'BEGIN{printf "%.0f", cpu*1.3+1}')
 CMAKE_OPTIONS="-DTEST_NETWORK_WITH_SUDO=ON"
@@ -61,7 +63,7 @@
     # nothing ahead in the pipeline -> fallback to the latest promoted artifact
     DEPSRCDIR=$(jq < ~/zuul-env.json -e -r ".projects[] | select(.name == \"CzechLight/dependencies\").src_dir")
     DEP_SUBMODULE_COMMIT=$(git --git-dir ${HOME}/${DEPSRCDIR}/.git rev-parse HEAD)
-    ARTIFACT_URL="https://object-store.cloud.muni.cz/swift/v1/ci-artifacts-${ZUUL_TENANT}/${ZUUL_GERRIT_HOSTNAME}/CzechLight/dependencies/${ZUUL_JOB_NAME%%-cover?(-previous)}/${DEP_SUBMODULE_COMMIT}.tar.zst"
+    ARTIFACT_URL="https://object-store.cloud.muni.cz/swift/v1/ci-artifacts-${ZUUL_TENANT}/${ZUUL_GERRIT_HOSTNAME}/CzechLight/dependencies/${ZUUL_JOB_NAME_NO_PROJECT%%-cover?(-previous)}/${DEP_SUBMODULE_COMMIT}.tar.zst"
 fi
 
 curl ${ARTIFACT_URL} | unzstd --stdout | tar -C ${PREFIX} -xf -