cerbero ci: Make before_script wiping more thorough
authorNirbheek Chauhan <nirbheek@centricular.com>
Fri, 2 Oct 2020 16:47:53 +0000 (22:17 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Fri, 2 Oct 2020 16:57:11 +0000 (22:27 +0530)
Will avoid packaging errors due to the old package file still being
around from a previous job, such as in:

https://gitlab.freedesktop.org/nirbheek/cerbero/-/jobs/4804147

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-ci/-/merge_requests/361>

gitlab/cerbero_setup.sh

index 5b319d3..d752ce7 100644 (file)
@@ -84,7 +84,7 @@ cerbero_package_and_check() {
 
 cerbero_before_script() {
     pwd
-    ls -lh
+    ls -lha
 
     # Copy cerbero git repo stored on the image
     cp -a "${CERBERO_HOST_DIR}/.git" .
@@ -110,8 +110,10 @@ cerbero_before_script() {
     time ./cerbero-uninstalled --self-update manifest.xml
 
     # GitLab runner does not always wipe the image after each job, so do that
-    # to ensure we always have a clean builddir
-    time $CERBERO $CERBERO_ARGS wipe --keep-sources --build-tools --force
+    # to ensure we don't have any leftover data from a previous job such as
+    # a dirty builddir, or tarballs/pkg files, leftover files from an old
+    # cerbero commit, etc. Skip the things we actually need to keep.
+    time git clean -xdff -e cerbero_setup.sh -e manifest.xml -e localconf.cbc -e "${CERBERO_SOURCES}"
 }
 
 cerbero_script() {