mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	Allow to define the tar binary path.
This commit is contained in:
		
							parent
							
								
									4735f0c51e
								
							
						
					
					
						commit
						c8d8689622
					
				@ -43,6 +43,7 @@ class CopyTask extends AbstractTask
 | 
				
			|||||||
        $hostPath = rtrim($this->runtime->getEnvOption('host_path'), '/');
 | 
					        $hostPath = rtrim($this->runtime->getEnvOption('host_path'), '/');
 | 
				
			||||||
        $currentReleaseId = $this->runtime->getReleaseId();
 | 
					        $currentReleaseId = $this->runtime->getReleaseId();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $tarPath = $this->runtime->getEnvOption('tar_extract_path', 'tar');
 | 
				
			||||||
        $flags = $this->runtime->getEnvOption('tar_extract', 'xfzop');
 | 
					        $flags = $this->runtime->getEnvOption('tar_extract', 'xfzop');
 | 
				
			||||||
        $targetDir = sprintf('%s/releases/%s', $hostPath, $currentReleaseId);
 | 
					        $targetDir = sprintf('%s/releases/%s', $hostPath, $currentReleaseId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -54,7 +55,7 @@ class CopyTask extends AbstractTask
 | 
				
			|||||||
        /** @var Process $process */
 | 
					        /** @var Process $process */
 | 
				
			||||||
        $process = $this->runtime->runLocalCommand($cmdCopy, 300);
 | 
					        $process = $this->runtime->runLocalCommand($cmdCopy, 300);
 | 
				
			||||||
        if ($process->isSuccessful()) {
 | 
					        if ($process->isSuccessful()) {
 | 
				
			||||||
            $cmdUnTar = sprintf('cd %s && tar %s %s', $targetDir, $flags, $tarRemote);
 | 
					            $cmdUnTar = sprintf('cd %s && %s %s %s', $targetDir, $tarPath, $flags, $tarRemote);
 | 
				
			||||||
            $process = $this->runtime->runRemoteCommand($cmdUnTar, false, 600);
 | 
					            $process = $this->runtime->runRemoteCommand($cmdUnTar, false, 600);
 | 
				
			||||||
            if ($process->isSuccessful()) {
 | 
					            if ($process->isSuccessful()) {
 | 
				
			||||||
                $cmdDelete = sprintf('rm %s/%s', $targetDir, $tarRemote);
 | 
					                $cmdDelete = sprintf('rm %s/%s', $targetDir, $tarRemote);
 | 
				
			||||||
 | 
				
			|||||||
@ -41,9 +41,10 @@ class PrepareTask extends AbstractTask
 | 
				
			|||||||
        $this->runtime->setVar('tar_local', $tarLocal);
 | 
					        $this->runtime->setVar('tar_local', $tarLocal);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $excludes = $this->getExcludes();
 | 
					        $excludes = $this->getExcludes();
 | 
				
			||||||
 | 
					        $tarPath = $this->runtime->getEnvOption('tar_create_path', 'tar');
 | 
				
			||||||
        $flags = $this->runtime->getEnvOption('tar_create', 'cfzp');
 | 
					        $flags = $this->runtime->getEnvOption('tar_create', 'cfzp');
 | 
				
			||||||
        $from = $this->runtime->getEnvOption('from', './');
 | 
					        $from = $this->runtime->getEnvOption('from', './');
 | 
				
			||||||
        $cmdTar = sprintf('tar %s %s %s %s', $flags, $tarLocal, $excludes, $from);
 | 
					        $cmdTar = sprintf('%s %s %s %s %s', $tarPath, $flags, $tarLocal, $excludes, $from);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /** @var Process $process */
 | 
					        /** @var Process $process */
 | 
				
			||||||
        $process = $this->runtime->runLocalCommand($cmdTar, 300);
 | 
					        $process = $this->runtime->runLocalCommand($cmdTar, 300);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user