]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
ci: Move everything to a separate directory
authorAndrea Bolognani <abologna@redhat.com>
Thu, 15 Aug 2019 12:06:14 +0000 (14:06 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 21 Aug 2019 16:58:13 +0000 (18:58 +0200)
We're going to have a few more CI-related files in a second, and
it makes sense to have a separate directory for them rather than
littering the root directory.

$(CI_SCRATCHDIR) can now also be created inside the CI directory,
and as a bonus the make rune necessary to start CI builds without
running configure first becomes shorter.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
.gitignore
.travis.yml
Makefile.am
ci/Makefile [moved from Makefile.ci with 96% similarity]

index dd5d35c762163c914a7fd8d7be704560cff3b836..82495e8692501f964940e9c877fd42c694c5dd8a 100644 (file)
@@ -44,7 +44,7 @@
 /autom4te.cache
 /build-aux/*
 /build/
-/ci-tree/
+/ci/scratch/
 /confdefs.h
 /config.cache
 /config.guess
index afddbe093ee13825c0df3f1136b19d95e1cda295..e475af34cf66c5c47eb2b383b7376175ff3da4aa 100644 (file)
@@ -22,28 +22,28 @@ matrix:
         - IMAGE="ubuntu-18"
         - MAKE_ARGS="syntax-check distcheck"
       script:
-        - make -f Makefile.ci ci-build@$IMAGE CI_MAKE_ARGS="$MAKE_ARGS"
+        - make -C ci/ ci-build@$IMAGE CI_MAKE_ARGS="$MAKE_ARGS"
     - services:
         - docker
       env:
         - IMAGE="centos-7"
         - MAKE_ARGS="syntax-check distcheck"
       script:
-        - make -f Makefile.ci ci-build@$IMAGE CI_MAKE_ARGS="$MAKE_ARGS"
+        - make -C ci/ ci-build@$IMAGE CI_MAKE_ARGS="$MAKE_ARGS"
     - services:
         - docker
       env:
         - IMAGE="fedora-30"
         - MINGW="mingw32"
       script:
-        - make -f Makefile.ci ci-build@$IMAGE CI_CONFIGURE="$MINGW-configure"
+        - make -C ci/ ci-build@$IMAGE CI_CONFIGURE="$MINGW-configure"
     - services:
         - docker
       env:
         - IMAGE="fedora-30"
         - MINGW="mingw64"
       script:
-        - make -f Makefile.ci ci-build@$IMAGE CI_CONFIGURE="$MINGW-configure"
+        - make -C ci/ ci-build@$IMAGE CI_CONFIGURE="$MINGW-configure"
     - compiler: clang
       language: c
       os: osx
index 27c49280c40cb5a475d602092e580e9b8195b7b6..b743b4b08b1cbca16e9d5817916c07c255298692 100644 (file)
@@ -35,7 +35,6 @@ EXTRA_DIST = \
   libvirt-qemu.pc.in \
   libvirt-lxc.pc.in \
   libvirt-admin.pc.in \
-  Makefile.ci \
   Makefile.nonreentrant \
   autogen.sh \
   cfg.mk \
@@ -51,6 +50,7 @@ EXTRA_DIST = \
   build-aux/prohibit-duplicate-header.pl \
   build-aux/useless-if-before-free \
   build-aux/vc-list-files \
+  ci/Makefile \
   $(NULL)
 
 pkgconfigdir = $(libdir)/pkgconfig
@@ -123,4 +123,4 @@ gen-AUTHORS:
        fi
 
 ci-%:
-       $(MAKE) -f Makefile.ci $@
+       $(MAKE) -C ci/ $@
similarity index 96%
rename from Makefile.ci
rename to ci/Makefile
index b5d328ee8cab77aebeb08a341748a420390813d8..fd15fbc32e107d07dd23442521bc2c29d5c70df5 100644 (file)
@@ -1,16 +1,15 @@
 # -*- makefile -*-
 # vim: filetype=make
 
-# Figure out name and path to this file. This isn't
-# portable but we only care for modern GNU make
-CI_MAKEFILE = $(abspath $(firstword $(MAKEFILE_LIST)))
+# The root directory of the libvirt.git checkout
+CI_GIT_ROOT = $(shell git rev-parse --show-toplevel)
+
+# The root directory for all CI-related contents
+CI_ROOTDIR = $(CI_GIT_ROOT)/ci
 
 # The directory holding content on the host that we will
 # expose to the container.
-CI_SCRATCHDIR = $(shell pwd)/ci-tree
-
-# The root directory of the libvirt.git checkout
-CI_GIT_ROOT = $(shell git rev-parse --show-toplevel)
+CI_SCRATCHDIR = $(CI_ROOTDIR)/scratch
 
 # The directory holding the clone of the git repo that
 # we will expose to the container
@@ -182,7 +181,7 @@ ci-prepare-tree: ci-check-engine
                cp /etc/group $(CI_SCRATCHDIR); \
                echo "Cloning $(CI_GIT_ROOT) to $(CI_HOST_SRCDIR)"; \
                git clone $(CI_GIT_ARGS) $(CI_GIT_ROOT) $(CI_HOST_SRCDIR) || exit 1; \
-               for mod in $$(git submodule | awk '{ print $$2 }') ; \
+               for mod in $$(git submodule | awk '{ print $$2 }' | sed -E 's,^../,,g') ; \
                do \
                        test -f $(CI_GIT_ROOT)/$$mod/.git || continue ; \
                        echo "Cloning $(CI_GIT_ROOT)/$$mod to $(CI_HOST_SRCDIR)/$$mod"; \
@@ -225,7 +224,7 @@ ci-build@%: ci-prepare-tree
        @test "$(CI_CLEAN)" = "1" && rm -rf $(CI_SCRATCHDIR) || :
 
 ci-check@%:
-       $(MAKE) -f $(CI_MAKEFILE) ci-build@$* CI_MAKE_ARGS="check"
+       $(MAKE) -C $(CI_ROOTDIR) ci-build@$* CI_MAKE_ARGS="check"
 
 ci-shell@%: ci-prepare-tree
        $(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) /bin/bash