/** * @param $installDir */ private function runCliCommands($installDir) { $this->ioService->writeln("<info>Running license import</info>"); $this->utilities->executeCommand("{$installDir}/bin/console sw:generate:attributes"); $this->utilities->executeCommand("{$installDir}/bin/console sw:plugin:refresh"); $this->utilities->executeCommand("{$installDir}/bin/console sw:plugin:install SwagLicense --activate"); $licenseFile = @getenv('HOME') . '/licenses.txt'; if (file_exists($licenseFile)) { $this->utilities->executeCommand("{$installDir}/bin/console swaglicense:import {$licenseFile}"); } }
/** * @param $installDir */ public function runBuildScripts($installDir) { $buildXml = $installDir . '/build/build.xml'; if (!file_exists($buildXml)) { $this->ioService->writeln("<error>Could not find {$buildXml}</error>"); $this->ioService->writeln("<error>If you checked out an SW version < 4.1.0, you can just import {$installDir}/_sql/demo/VERSION.sql</error>"); return; } $this->ioService->writeln("<info>Running build-unit</info>"); $this->utilities->executeCommand("ant -f {$buildXml} build-unit"); }
/** * @param string $branch * @param string $cloneUrl * @param string $absPath * @param string $pluginName */ private function installPlugin($branch, $cloneUrl, $absPath, $pluginName) { $this->gitUtil->run("clone --progress {$cloneUrl} {$absPath}"); if ($branch) { // the CWD change is a fix for older versions of GIT which do not support the -C flag $cwd = getcwd(); $this->utilities->changeDir($absPath); $this->gitUtil->run("checkout {$branch}"); $this->utilities->changeDir($cwd); } $branch = $branch ?: 'master'; $this->ioService->writeln("Successfully checked out '{$branch}' for '{$pluginName}'\n"); }
/** * @param string $branch * @param string $absPath * @param string $pluginName */ private function updatePlugin($branch, $absPath, $pluginName) { $this->ioService->writeln("Plugin is already installed"); $this->utilities->changeDir($absPath); $this->gitUtil->run("fetch --progress origin"); $output = $this->gitUtil->run("log HEAD..origin/master --oneline"); if (trim($output) === '') { $this->ioService->writeln("Plugin '{$pluginName}' ist Up to date"); if ($branch) { $this->gitUtil->run("checkout {$branch}"); } return; } $this->ioService->writeln("Incomming Changes:"); $this->ioService->writeln($output); $this->gitUtil->run("reset --hard HEAD"); $this->gitUtil->run("pull"); if ($branch) { $this->gitUtil->run("-C {$absPath} checkout {$branch}"); } $this->ioService->writeln("Plugin '{$pluginName}' successfully updated.\n"); return; }
/** * @param string $directory */ public function zipDir($directory, $outputFile) { $this->utilities->executeCommand("zip -r {$outputFile} {$directory} -x *.git*"); }