[libvirt PATCH 14/20] ci: build.sh: Document CI_CONT_SRCDIR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This variable is specific to local container execution and is a result
of the hierarchy we chose for local container executions:

    $ ls
    build libvirt # build is the script, libvirt is a repo clone

The variable would never be populated in GitLab environment, so we set
the default to $PWD to make it harmless in such a case.

Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx>
---
 ci/build.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ci/build.sh b/ci/build.sh
index aeb1bf4b05..4d7ef810f2 100644
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -7,7 +7,10 @@ export PATH="$CCACHE_WRAPPERSDIR:$PATH"
 export VIR_TEST_VERBOSE="1"
 export VIR_TEST_DEBUG="1"
 
-cd "$CI_CONT_SRCDIR"
+# CI_CONT_SRCDIR will only ever be set in local container executions. For
+# GitLab CI environment the variable defaults to $PWD to avoid any disruptions
+# in the expected environment view.
+cd "${CI_CONT_SRCDIR:=$PWD}"
 
 # $MESON_OPTS is an env that can optionally be set in the container,
 # populated at build time from the Dockerfile. A typical use case would
-- 
2.39.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux