From ec02c4f2e695d964b8abc5b651b7e15be25a6ee9 Mon Sep 17 00:00:00 2001 From: Yves Hoppe Date: Thu, 29 Oct 2015 15:49:33 +0100 Subject: [PATCH] Added local caching for the cloned joomla-cms --- RoboFile.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index a104e85..9cb5cae 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -164,9 +164,10 @@ class RoboFile extends \Robo\Tasks */ public function createTestingSite() { - if (!empty($this->configuration->skipClone)) { - $this->say('Reusing Joomla CMS site already present at tests/joomla-cms3'); - return; + // Caching cloned installations locally + if (!is_dir('tests/cache') || (time() - filemtime('tests/cache') > 60 * 60 * 24)) + { + $this->_exec('git' . $this->extension . ' clone -b staging --single-branch --depth 1 https://github.com/joomla/joomla-cms.git tests/cache'); } // Get Joomla Clean Testing sites @@ -175,7 +176,9 @@ class RoboFile extends \Robo\Tasks $this->taskDeleteDir('tests/joomla-cms3')->run(); } - $this->_exec('git' . $this->extension . ' clone -b staging --single-branch --depth 1 https://github.com/joomla/joomla-cms.git tests/joomla-cms3'); + // Copy cache to the testing folder + $this->_copyDir('tests/cache', 'tests/joomla-cms3'); + $this->say('Joomla CMS site created at tests/joomla-cms3'); }