ci_template: avoid exporting the mediafiles into build artifacts
authorJordan Petridis <jordan@centricular.com>
Thu, 16 Apr 2020 18:11:36 +0000 (21:11 +0300)
committerJordan Petridis <jordan@centricular.com>
Fri, 17 Apr 2020 19:46:34 +0000 (22:46 +0300)
Previously we where accidently exporting the whole repo of
gst-integration-testsuites which includes 350mb of raw media
files and made the artifacts storage explode through the roof
along with the CI bills fd.o had to pay for uploading and
redownloading the artifacts

To deal with this, we clean all the media files from the builddir
and when needed we copy them over from the cache in the docker image,
and then git fetch the repo.

Close #69

gitlab/ci_template.yml

index 6e1a5fa..4e4d901 100644 (file)
@@ -157,11 +157,18 @@ gst indent:
     - rm -rf subprojects/glib/tests
     - rm -rf subprojects/glib/po
     - rm -rf subprojects/glib/docs
+
+    # Clear gst-intergrations-testsuites report as it contains raw media
+    # files which is only needed for validate jobs. When needed we copy the
+    # cached repo in the docker image and fetch.
+    - rm -rf subprojects/gst-integration-testsuites
   artifacts:
     expire_in: "7 days"
     when: "always"
     paths:
       - 'gst-build/build/meson-logs/'
+      # Needed by the integration tests
+      - 'manifest.xml'
 
 .build fedora x86_64:
   extends: '.build'
@@ -271,6 +278,18 @@ integration testsuites fedora:
     TEST_SUITE: "validate ges"
   rules:
     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-omx|gst-plugins-rs)$/'
+  before_script:
+    # Avoid cloning the repo since it contains media files,
+    # instead copy it from the cache and do a git fetch
+    # We remove this copy first since it had its mediafiles stripped
+    - cp -r /gst-build/subprojects/gst-integration-testsuites/ "${CI_PROJECT_DIR}/gst-build/subprojects/gst-integration-testsuites/"
+    - curl -o clone_manifest_ref.py "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py"
+    - >-
+      python3 clone_manifest_ref.py
+      --fetch
+      --manifest manifest.xml
+      --project gst-integration-testsuites
+      --destination gst-build/subprojects/gst-integration-testsuites
 
 gstreamer-full:
   extends: 'build static fedora x86_64'