Skip to content
Snippets Groups Projects
Commit 3fc00824 authored by hahn's avatar hahn
Browse files

- new hook: onbuild-postclone

parent 5ad71c80
No related branches found
No related tags found
No related merge requests found
...@@ -805,7 +805,7 @@ class project { ...@@ -805,7 +805,7 @@ class project {
switch ($this->_aPrjConfig["build"]["type"]) { switch ($this->_aPrjConfig["build"]["type"]) {
case "git": case "git":
$sReturn.="<h3>Checkout a GIT project</h3>"; $sReturn.="<h3>Clone the GIT Repository</h3>";
// $sReturn.=$this->_execAndSend("find " . $this->_aConfig["workDir"]); // $sReturn.=$this->_execAndSend("find " . $this->_aConfig["workDir"]);
// SKIP $sReturn.=$this->_execAndSend("cd $sTempDir && git init"); // SKIP $sReturn.=$this->_execAndSend("cd $sTempDir && git init");
...@@ -839,6 +839,22 @@ class project { ...@@ -839,6 +839,22 @@ class project {
$sReturn.=$this->getBox("success", "Checkout OK!"); $sReturn.=$this->getBox("success", "Checkout OK!");
// --------------------------------------------------
// execute hook postclone
// --------------------------------------------------
$sHookfile = $this->_aConfig['hooks']['build-postclone'];
$sReturn.='<h3>Execute Hook ' . $sHookfile . '</h3>';
if (file_exists($sTempDir . '/' . $sHookfile)) {
$sReturn.=$this->_execAndSend('cd ' . $sTempDir . ' && chmod 755 hooks/on*');
$sReturn.=$this->_execAndSend('bash --login -c \'' . $sTempDir . '/' . $sHookfile . '\'');
if (!$this->_iRcAll == 0) {
return $this->getBox("error", "executing hook failed. One of the commands failed.<br>You can ask the sysadmins and analyze with them the created temp directory &quot;' . $sTempDir . '&quot;." . $sReturn);
}
} else {
$sReturn.='SKIP. Hook was not found.<br>';
}
// -------------------------------------------------- // --------------------------------------------------
// copy default structure // copy default structure
// -------------------------------------------------- // --------------------------------------------------
...@@ -855,7 +871,7 @@ class project { ...@@ -855,7 +871,7 @@ class project {
// -------------------------------------------------- // --------------------------------------------------
// execute hook // execute hook
// -------------------------------------------------- // --------------------------------------------------
$sHookfile = $this->_aConfig['hooks']['build-aftercheckout']; $sHookfile = $this->_aConfig['hooks']['build-precompress'];
$sReturn.='<h3>Execute Hook ' . $sHookfile . '</h3>'; $sReturn.='<h3>Execute Hook ' . $sHookfile . '</h3>';
if (file_exists($sTempDir . '/' . $sHookfile)) { if (file_exists($sTempDir . '/' . $sHookfile)) {
$sReturn.=$this->_execAndSend('cd ' . $sTempDir . ' && chmod 755 hooks/on*'); $sReturn.=$this->_execAndSend('cd ' . $sTempDir . ' && chmod 755 hooks/on*');
......
...@@ -12,7 +12,8 @@ $aConfig=array( ...@@ -12,7 +12,8 @@ $aConfig=array(
'versionsToKeep'=>10, // for cleanup: keep n unused versions 'versionsToKeep'=>10, // for cleanup: keep n unused versions
'builtsToKeep'=>3, // for cleanup: keep n failed builds 'builtsToKeep'=>3, // for cleanup: keep n failed builds
'hooks'=>array( 'hooks'=>array(
'build-aftercheckout'=>'hooks/onbuild', 'build-postclone'=>'hooks/onbuild-postclone',
'build-precompress'=>'hooks/onbuild',
), ),
// rsync of archives // rsync of archives
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment