mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	
							parent
							
								
									9c0682d222
								
							
						
					
					
						commit
						1bcaca36f0
					
				@ -83,12 +83,20 @@ class RsyncTask extends BaseStrategyTaskAbstract implements IsReleaseAware
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Strategy Flags
 | 
				
			||||||
 | 
					        $strategyFlags = $this->getConfig()->deployment('strategy_flags', $this->getConfig()->general('strategy_flags', array()));
 | 
				
			||||||
 | 
					        if (isset($strategyFlags['rsync'])) {
 | 
				
			||||||
 | 
					            $strategyFlags = $strategyFlags['rsync'];
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            $strategyFlags = '';
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $command = 'rsync -avz '
 | 
					        $command = 'rsync -avz '
 | 
				
			||||||
 | 
					                 . $strategyFlags . ' '
 | 
				
			||||||
                 . '--rsh="ssh ' . $this->getConfig()->getHostIdentityFileOption() . '-p' . $this->getConfig()->getHostPort() . '" '
 | 
					                 . '--rsh="ssh ' . $this->getConfig()->getHostIdentityFileOption() . '-p' . $this->getConfig()->getHostPort() . '" '
 | 
				
			||||||
                 . $this->excludes($excludes) . ' '
 | 
					                 . $this->excludes($excludes) . ' '
 | 
				
			||||||
                 . $this->getConfig()->deployment('from') . ' '
 | 
					                 . $this->getConfig()->deployment('from') . ' '
 | 
				
			||||||
                 . $this->getConfig()->deployment('user') . '@' . $this->getConfig()->getHostName() . ':' . $deployToDirectory;
 | 
					                 . $this->getConfig()->deployment('user') . '@' . $this->getConfig()->getHostName() . ':' . $deployToDirectory;
 | 
				
			||||||
 | 
					 | 
				
			||||||
        $result = $this->runCommandLocal($command);
 | 
					        $result = $this->runCommandLocal($command);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this->cleanUpReleases();
 | 
					        $this->cleanUpReleases();
 | 
				
			||||||
 | 
				
			|||||||
@ -67,16 +67,40 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware
 | 
				
			|||||||
            $excludeCmd .= ' --exclude=' . $excludeFile;
 | 
					            $excludeCmd .= ' --exclude=' . $excludeFile;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $command = 'tar cfzh ' . $localTarGz . '.tar.gz ' . $excludeCmd . ' -C ' . $this->getConfig()->deployment('from') . ' .';
 | 
					        // Strategy Flags
 | 
				
			||||||
 | 
					        $strategyFlags = $this->getConfig()->deployment('strategy_flags', $this->getConfig()->general('strategy_flags', array()));
 | 
				
			||||||
 | 
					        if (isset($strategyFlags['targz']) && isset($strategyFlags['targz']['create'])) {
 | 
				
			||||||
 | 
					            $strategyFlags = $strategyFlags['targz']['create'];
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            $strategyFlags = '';
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $command = 'tar cfzh' . $strategyFlags . ' ' . $localTarGz . '.tar.gz ' . $excludeCmd . ' -C ' . $this->getConfig()->deployment('from') . ' .';
 | 
				
			||||||
        $result = $this->runCommandLocal($command);
 | 
					        $result = $this->runCommandLocal($command);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Strategy Flags
 | 
				
			||||||
 | 
					        $strategyFlags = $this->getConfig()->deployment('strategy_flags', $this->getConfig()->general('strategy_flags', array()));
 | 
				
			||||||
 | 
					        if (isset($strategyFlags['targz']) && isset($strategyFlags['targz']['exctract'])) {
 | 
				
			||||||
 | 
					            $strategyFlags = $strategyFlags['targz']['exctract'];
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            $strategyFlags = '';
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Copy Tar Gz  to Remote Host
 | 
					        // Copy Tar Gz  to Remote Host
 | 
				
			||||||
        $command = 'scp ' . $this->getConfig()->getHostIdentityFileOption() . '-P ' . $this->getConfig()->getHostPort() . ' ' . $localTarGz . '.tar.gz '
 | 
					        $command = 'scp ' . $strategyFlags . ' ' . $this->getConfig()->getHostIdentityFileOption() . '-P ' . $this->getConfig()->getHostPort() . ' ' . $localTarGz . '.tar.gz '
 | 
				
			||||||
            . $this->getConfig()->deployment('user') . '@' . $this->getConfig()->getHostName() . ':' . $deployToDirectory;
 | 
					                 . $this->getConfig()->deployment('user') . '@' . $this->getConfig()->getHostName() . ':' . $deployToDirectory;
 | 
				
			||||||
        $result = $this->runCommandLocal($command) && $result;
 | 
					        $result = $this->runCommandLocal($command) && $result;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Strategy Flags
 | 
				
			||||||
 | 
					        $strategyFlags = $this->getConfig()->deployment('strategy_flags', $this->getConfig()->general('strategy_flags', array()));
 | 
				
			||||||
 | 
					        if (isset($strategyFlags['targz']) && isset($strategyFlags['targz']['scp'])) {
 | 
				
			||||||
 | 
					            $strategyFlags = $strategyFlags['targz']['scp'];
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            $strategyFlags = '';
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Extract Tar Gz
 | 
					        // Extract Tar Gz
 | 
				
			||||||
        $command = $this->getReleasesAwareCommand('tar xfz ' . $remoteTarGz . '.tar.gz');
 | 
					        $command = $this->getReleasesAwareCommand('tar xfz' . $strategyFlags . ' ' . $remoteTarGz . '.tar.gz');
 | 
				
			||||||
        $result = $this->runCommandRemote($command) && $result;
 | 
					        $result = $this->runCommandRemote($command) && $result;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Delete Tar Gz from Remote Host
 | 
					        // Delete Tar Gz from Remote Host
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user