Skip to content
Snippets Groups Projects
Commit f1dae944 authored by Axel Hahn's avatar Axel Hahn
Browse files

- added cronjob to cache branches and tags

parent 5069ddf6
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
*/ */
// set a custom cache direcory // set a custom cache direcory
// $this->_sCacheDir="/tmp/ahcache"; $this->_sCacheDir="/var/tmp/ahcache";
// if you have a large number of items to cache: // if you have a large number of items to cache:
// you can limit the files per cache subdir in an indirect way // you can limit the files per cache subdir in an indirect way
......
...@@ -311,9 +311,11 @@ class vcs implements iVcs { ...@@ -311,9 +311,11 @@ class vcs implements iVcs {
} }
// try to get infos from the cache // try to get infos from the cache
if ( if (
(array_key_exists($sBranch, $this->_aRemoteBranches) && $sVerifyRevision && $this->_aRemoteBranches[$sBranch]['revision'] == $sVerifyRevision is_array($this->_aRemoteBranches)
) || && (
(array_key_exists($sBranch, $this->_aRemoteBranches) && !$sVerifyRevision array_key_exists($sBranch, $this->_aRemoteBranches) && $sVerifyRevision && $this->_aRemoteBranches[$sBranch]['revision'] == $sVerifyRevision
||
array_key_exists($sBranch, $this->_aRemoteBranches) && !$sVerifyRevision
) )
) { ) {
// it is up to date - doing nothing // it is up to date - doing nothing
......
<?php
/**
*
* CRONJOB
* cache all git branches
*
*/
// http://iml:deployment@ci.iml.unibe.ch/deployment/?prj=ci&action=deploy&par3=preview&confirm=1
$sDocroot = (dirname(__dir__)) . "/public_html";
require_once("$sDocroot/deployment/classes/logger.class.php");
global $oCLog;
$oCLog = new logger();
require_once("$sDocroot/../config/inc_projects_config.php");
require_once("$sDocroot/deployment/inc_functions.php");
require_once("$sDocroot/deployment/classes/project.class.php");
$oPrj1 = new project();
echo "<h1>===== IMLDEPLOYMENT - cache git branches =====</h1>\n";
foreach ($oPrj1->getProjects() as $sPrj) {
$oPrj = new project($sPrj);
echo "----- $sPrj:\n";
foreach($oPrj->getRemoteBranches() as $aBranch){
echo $aBranch['revision']." ".$aBranch['label'] . "<br>\n";
}
echo "<br>\n";
}
echo "done\n";
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment