[libvirt] [jenkins-ci PATCH] Forcefully remove build/ directory for autotools builds

Andrea Bolognani abologna at redhat.com
Thu Sep 20 10:37:12 UTC 2018


Normally this shouldn't be needed, because 'git clean -xdf' is
executed after updating the git repository and before starting
the build; however, some RPM builds (notably libvirt's)
internally use git to apply patches, and if one of those fails
it will leave a git repository inside of build/ behind, which
'git clean' dutifully refuses to remove and whose presence
will in turn cause 'mkdir build', and thus the entire build,
to fail.

Solve the issue by forcefully removing build/ ourselves before
starting an autotools build.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 guests/playbooks/build/jobs/autotools-build-job.yml | 1 +
 jobs/autotools.yaml                                 | 1 +
 2 files changed, 2 insertions(+)

diff --git a/guests/playbooks/build/jobs/autotools-build-job.yml b/guests/playbooks/build/jobs/autotools-build-job.yml
index bf7a616..01b6ff5 100644
--- a/guests/playbooks/build/jobs/autotools-build-job.yml
+++ b/guests/playbooks/build/jobs/autotools-build-job.yml
@@ -6,6 +6,7 @@
 
     {{ global_env }}
     {{ local_env }}
+    rm -rf build
     mkdir build
     cd build
     ../autogen.sh --prefix=$VIRT_PREFIX {{ autogen_args }}
diff --git a/jobs/autotools.yaml b/jobs/autotools.yaml
index 8956855..9349b8c 100644
--- a/jobs/autotools.yaml
+++ b/jobs/autotools.yaml
@@ -41,6 +41,7 @@
       - shell: |
           {global_env}
           {local_env}
+          rm -rf build
           mkdir build
           cd build
           ../autogen.sh --prefix=$VIRT_PREFIX {autogen_args}
-- 
2.17.1




More information about the libvir-list mailing list