提交 82c31101 编写于 作者: A Andrea Bolognani

ci: Generalize running commands inside the container

Both for ci-build and ci-shell we want to execute basically
the same setup and cleanup logic, the only difference being
that for the former we then run the build script and with the
latter a shell.

Rework the targets so that they both call the generic
ci-run-command rule passing an appropriate $(CI_COMMAND).
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 0d1aecdd
...@@ -210,7 +210,7 @@ ci-prepare-tree: ci-check-engine ...@@ -210,7 +210,7 @@ ci-prepare-tree: ci-check-engine
done ; \ done ; \
fi fi
ci-build@%: ci-prepare-tree ci-run-command@%: ci-prepare-tree
$(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \ $(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \
/bin/bash -c ' \ /bin/bash -c ' \
export CI_CONT_SRCDIR="$(CI_CONT_SRCDIR)"; \ export CI_CONT_SRCDIR="$(CI_CONT_SRCDIR)"; \
...@@ -219,16 +219,18 @@ ci-build@%: ci-prepare-tree ...@@ -219,16 +219,18 @@ ci-build@%: ci-prepare-tree
export CI_CONFIGURE="$(CI_CONFIGURE)"; \ export CI_CONFIGURE="$(CI_CONFIGURE)"; \
export CI_CONFIGURE_ARGS="$(CI_CONFIGURE_ARGS)"; \ export CI_CONFIGURE_ARGS="$(CI_CONFIGURE_ARGS)"; \
export CI_MAKE_ARGS="$(CI_MAKE_ARGS)"; \ export CI_MAKE_ARGS="$(CI_MAKE_ARGS)"; \
$(CI_USER_HOME)/build || exit 1' $(CI_COMMAND) || exit 1'
@test "$(CI_CLEAN)" = "1" && rm -rf $(CI_SCRATCHDIR) || : @test "$(CI_CLEAN)" = "1" && rm -rf $(CI_SCRATCHDIR) || :
ci-shell@%:
$(MAKE) -C $(CI_ROOTDIR) ci-run-command@$* CI_COMMAND="/bin/bash"
ci-build@%:
$(MAKE) -C $(CI_ROOTDIR) ci-run-command@$* CI_COMMAND="$(CI_USER_HOME)/build"
ci-check@%: ci-check@%:
$(MAKE) -C $(CI_ROOTDIR) 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
@test "$(CI_CLEAN)" = "1" && rm -rf $(CI_SCRATCHDIR) || :
ci-help: ci-help:
@echo "Build libvirt inside containers used for CI" @echo "Build libvirt inside containers used for CI"
@echo @echo
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册