提交 ffad19f9 编写于 作者: A Andrea Bolognani

ci: Move everything to a separate directory

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: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 75f5affd
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
/autom4te.cache /autom4te.cache
/build-aux/* /build-aux/*
/build/ /build/
/ci-tree/ /ci/scratch/
/confdefs.h /confdefs.h
/config.cache /config.cache
/config.guess /config.guess
......
...@@ -22,28 +22,28 @@ matrix: ...@@ -22,28 +22,28 @@ matrix:
- IMAGE="ubuntu-18" - IMAGE="ubuntu-18"
- MAKE_ARGS="syntax-check distcheck" - MAKE_ARGS="syntax-check distcheck"
script: 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: - services:
- docker - docker
env: env:
- IMAGE="centos-7" - IMAGE="centos-7"
- MAKE_ARGS="syntax-check distcheck" - MAKE_ARGS="syntax-check distcheck"
script: 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: - services:
- docker - docker
env: env:
- IMAGE="fedora-30" - IMAGE="fedora-30"
- MINGW="mingw32" - MINGW="mingw32"
script: script:
- make -f Makefile.ci ci-build@$IMAGE CI_CONFIGURE="$MINGW-configure" - make -C ci/ ci-build@$IMAGE CI_CONFIGURE="$MINGW-configure"
- services: - services:
- docker - docker
env: env:
- IMAGE="fedora-30" - IMAGE="fedora-30"
- MINGW="mingw64" - MINGW="mingw64"
script: script:
- make -f Makefile.ci ci-build@$IMAGE CI_CONFIGURE="$MINGW-configure" - make -C ci/ ci-build@$IMAGE CI_CONFIGURE="$MINGW-configure"
- compiler: clang - compiler: clang
language: c language: c
os: osx os: osx
......
...@@ -35,7 +35,6 @@ EXTRA_DIST = \ ...@@ -35,7 +35,6 @@ EXTRA_DIST = \
libvirt-qemu.pc.in \ libvirt-qemu.pc.in \
libvirt-lxc.pc.in \ libvirt-lxc.pc.in \
libvirt-admin.pc.in \ libvirt-admin.pc.in \
Makefile.ci \
Makefile.nonreentrant \ Makefile.nonreentrant \
autogen.sh \ autogen.sh \
cfg.mk \ cfg.mk \
...@@ -51,6 +50,7 @@ EXTRA_DIST = \ ...@@ -51,6 +50,7 @@ EXTRA_DIST = \
build-aux/prohibit-duplicate-header.pl \ build-aux/prohibit-duplicate-header.pl \
build-aux/useless-if-before-free \ build-aux/useless-if-before-free \
build-aux/vc-list-files \ build-aux/vc-list-files \
ci/Makefile \
$(NULL) $(NULL)
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
...@@ -123,4 +123,4 @@ gen-AUTHORS: ...@@ -123,4 +123,4 @@ gen-AUTHORS:
fi fi
ci-%: ci-%:
$(MAKE) -f Makefile.ci $@ $(MAKE) -C ci/ $@
# -*- makefile -*- # -*- makefile -*-
# vim: filetype=make # vim: filetype=make
# Figure out name and path to this file. This isn't # The root directory of the libvirt.git checkout
# portable but we only care for modern GNU make CI_GIT_ROOT = $(shell git rev-parse --show-toplevel)
CI_MAKEFILE = $(abspath $(firstword $(MAKEFILE_LIST)))
# The root directory for all CI-related contents
CI_ROOTDIR = $(CI_GIT_ROOT)/ci
# The directory holding content on the host that we will # The directory holding content on the host that we will
# expose to the container. # expose to the container.
CI_SCRATCHDIR = $(shell pwd)/ci-tree CI_SCRATCHDIR = $(CI_ROOTDIR)/scratch
# The root directory of the libvirt.git checkout
CI_GIT_ROOT = $(shell git rev-parse --show-toplevel)
# The directory holding the clone of the git repo that # The directory holding the clone of the git repo that
# we will expose to the container # we will expose to the container
...@@ -182,7 +181,7 @@ ci-prepare-tree: ci-check-engine ...@@ -182,7 +181,7 @@ ci-prepare-tree: ci-check-engine
cp /etc/group $(CI_SCRATCHDIR); \ cp /etc/group $(CI_SCRATCHDIR); \
echo "Cloning $(CI_GIT_ROOT) to $(CI_HOST_SRCDIR)"; \ echo "Cloning $(CI_GIT_ROOT) to $(CI_HOST_SRCDIR)"; \
git clone $(CI_GIT_ARGS) $(CI_GIT_ROOT) $(CI_HOST_SRCDIR) || exit 1; \ 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 \ do \
test -f $(CI_GIT_ROOT)/$$mod/.git || continue ; \ test -f $(CI_GIT_ROOT)/$$mod/.git || continue ; \
echo "Cloning $(CI_GIT_ROOT)/$$mod to $(CI_HOST_SRCDIR)/$$mod"; \ echo "Cloning $(CI_GIT_ROOT)/$$mod to $(CI_HOST_SRCDIR)/$$mod"; \
...@@ -225,7 +224,7 @@ ci-build@%: ci-prepare-tree ...@@ -225,7 +224,7 @@ ci-build@%: ci-prepare-tree
@test "$(CI_CLEAN)" = "1" && rm -rf $(CI_SCRATCHDIR) || : @test "$(CI_CLEAN)" = "1" && rm -rf $(CI_SCRATCHDIR) || :
ci-check@%: 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-shell@%: ci-prepare-tree
$(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) /bin/bash $(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) /bin/bash
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册