diff --git a/config/lang/de.json b/config/lang/de.json index bcc10bdc99462eb72605719fa633511936b5788c..8a0cece6c6076b18d214fd07bf5b46ee54310afa 100644 --- a/config/lang/de.json +++ b/config/lang/de.json @@ -302,6 +302,7 @@ "repositoryinfos": "Quell-Repository", "repository-access-browser": "Browserzugriff auf das Repo", "repository-auth": "Authentifizierung/ Dateiname zum SSH-Private-Key", + "repository-has-public-dir": "Webprojekt mit <em>public</em> bzw. <em>public_html</em> Verzeichnis?", "repository-url": "URL zum Repository", "repository-urlwebgui": "URL zur Web GUI des Repositorys", "revision": "Revision", diff --git a/config/lang/en.json b/config/lang/en.json index 484a2494cbe8a08a3a2b069fabece879012d16de..4a7102bbd175a6efd18f391741d2bd14ad181dcf 100644 --- a/config/lang/en.json +++ b/config/lang/en.json @@ -304,6 +304,7 @@ "repositoryinfos": "Sourcecode Repository", "repository-access-browser": "Browser access to sources", "repository-auth": "Authentication/ filename of ssh private key", + "repository-has-public-dir": "Is it a web projekt with subdirectory <em>public</em> or <em>public_html</em>?", "repository-url": "URL to repository", "repository-urlwebgui": "URL zur Web GUI des Repositorys", "revision": "Revision", diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index 55bfe498a69ef615bb3b8165dfb5e78022fabf82..02122557a2d85967a37e0fb657fe26150e9b44a6 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -1635,24 +1635,27 @@ class project extends base { // -------------------------------------------------- $sReturn.='<h3>' . t('class-project-build-label-create-package') . '</h3>'; // public_html must exist + if (array_key_exists('haspublic', $this->_aPrjConfig["build"]) + && $this->_aPrjConfig["build"]["haspublic"][0] + ){ + $sReturn.='<p>DO check for docroot<p>'; + $sWebroot = false; + $sWebroot1 = $sTempDir . '/public_html'; + $sWebroot2 = $sTempDir . '/public'; + if (file_exists($sWebroot1)) { + $sWebroot = $sWebroot1; + } + if (file_exists($sWebroot2)) { + $sWebroot = $sWebroot2; + } - $sWebroot = false; - $sWebroot1 = $sTempDir . '/public_html'; - $sWebroot2 = $sTempDir . '/public'; - if (file_exists($sWebroot1)) { - $sWebroot = $sWebroot1; - } - if (file_exists($sWebroot2)) { - $sWebroot = $sWebroot2; - } - - if (!$sWebroot) { - $this->_TempDelete(); - $sError = t('class-project-error-build-docroot-not-found'); - $this->_logaction($sError, __FUNCTION__, "error"); - return $oHtml->getBox("error", $sError . $sReturn); + if (!$sWebroot) { + $this->_TempDelete(); + $sError = t('class-project-error-build-docroot-not-found'); + $this->_logaction($sError, __FUNCTION__, "error"); + return $oHtml->getBox("error", $sError . $sReturn . $sError); + } } - if (!$this->_iRcAll == 0) { $this->_TempDelete(); $sError = sprintf(t('class-project-error-command-failed'), $sTempDir) . $sReturn; @@ -1664,7 +1667,7 @@ class project extends base { $sTs = date("Y-m-d H:i:s"); $sTs2 = date("Ymd_His"); $sBranch = ($this->_sBranchname ? $this->_sBranchname : t("defaultbranch")); - $sInfoFileWebroot = $sWebroot . '/' . basename($this->_getInfofile($sFirstLevel, "deployed")); + $sInfoFileWebroot = $sTempDir . '/' . basename($this->_getInfofile($sFirstLevel, "deployed")); $sInfoFileArchiv = $this->_getArchiveDir($sTs2) . '/' . basename($this->_getInfofile($sFirstLevel, "deployed")); $sPackageFileArchiv = $this->_getArchiveDir($sTs2) . '/' . basename($this->_getPackagefile($sFirstLevel, "deployed")); @@ -3275,6 +3278,25 @@ class project extends base { 'placeholder' => '', ), 'input' . $i++ => $aPrefixItem, + 'input' . $i++ => array( + 'type' => 'markup', + 'value' => '<div style="clear: both"></div>', + ), + // task#1498 - handle project without "public" directory + 'input' . $i++ => array( + 'type' => 'checkbox', + 'name' => 'build[haspublic]', + 'label' => t("repository-has-public-dir"), + 'required' => false, + 'validate' => 'isastring', + 'options' => array( + '1' => array( + 'label' => t("yes"), + 'checked' => (array_key_exists('haspublic', $this->_aPrjConfig["build"]) ? $this->_aPrjConfig["build"]["haspublic"] : 1), + ), + ), + ), + // -------------------------------------------------- 'input' . $i++ => array( 'type' => 'markup',