Bug #59420

Make $localPackagePath configurable in RsyncTask

Added by Andreas Dörler over 7 years ago. Updated almost 6 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Target version:
-
Start date:
2014-06-09
Due date:
% Done:

0%

Estimated time:

Description

Hi,

currently $localPackagePath is hardcoded to

$localPackagePath = $deployment->getWorkspacePath($application);

and the workspacePath is not configurable as far as I've seen:
  /**
   * Get a local workspace directory for the application
   */
  public function getWorkspacePath(Application $application) {
    return FLOW_PATH_DATA . 'Surf/' . $this->getName() . '/' . $application->getName();
  }

If one uses Jenkins for deployment, the source will be checked out from GIT by Jenkins itself, so there is no need to do it again in SURF.
Currently we use the following workaround:

  $application->setOption('transferMethod', NULL); // disable rsync
  $application->setOption('packageMethod', NULL); // disable SURF git checkout - we use jenkins git checkout
  $application->setOption('customrsync', array('customLocalPackagePath', '/var/lib/jenkins/workspace/'.$application->getName()));
  $workflow->addTask('typo3.surf:transfer:customrsync', 'transfer', $application);

In a copy of the default RsyncTask we use the given option if set:
$localPackagePath = (isset($options['customrsync']['customLocalPackagePath'])) ? $options['customrsync']['customLocalPackagePath'] : $deployment->getWorkspacePath($application);

It would be great to have this option included in TYPO3.Surf.

Kind regards
Andreas

Also available in: Atom PDF