From c9b7407e1a2d8ad2fcd00a86aec9043cf091d77a Mon Sep 17 00:00:00 2001
From: Jon Azpiazu <jon.azpiazu@tecnalia.com>
Date: Thu, 16 Sep 2021 12:31:23 +0200
Subject: [PATCH] Add lfs anchor

---
 ci-templates/core.yml | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/ci-templates/core.yml b/ci-templates/core.yml
index 42589fe..c9681ed 100644
--- a/ci-templates/core.yml
+++ b/ci-templates/core.yml
@@ -28,4 +28,16 @@ include :
 
 default:
   tags:
-  - docker
\ No newline at end of file
+  - docker
+
+.lfs_setup_template: &lfs_setup_definition # Hidden key that defines an anchor
+  AFTER_SETUP_UPSTREAM_WORKSPACE: "bash <(curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh);\
+                  apt install -qq -y git-lfs; \
+                  git config --global credential.helper store; \
+                  echo https://$ARTIFACT_CI_USER:$ARTIFACT_CI_TOKEN@artifact.tecnalia.com > ~/.git-credentials ;\
+                  cd ~/upstream_ws ;\
+                  find . -type f -name .lfsconfig -execdir git lfs pull \\; ;\
+                  find . -type f -name .lfsconfig -execdir git lfs ls-files \\; ;\
+                  cd ~/target_ws ;\
+                  find . -type f -name .lfsconfig -execdir git lfs pull \\; ;\
+                  find . -type f -name .lfsconfig -execdir git lfs ls-files \\; ;"
-- 
GitLab