From 18e86d0a91a112b8e38beec30d5d9b9cd63bbc52 Mon Sep 17 00:00:00 2001 From: Maxime Fabre Date: Sun, 31 Jul 2016 11:48:30 +0200 Subject: [PATCH] I've been using this wrong all these years and nobody ever told me --- src/Rocketeer/Binaries/AbstractBinary.php | 2 +- src/Rocketeer/Binaries/{Scm => Vcs}/Git.php | 10 ++--- src/Rocketeer/Binaries/{Scm => Vcs}/Hg.php | 8 ++-- src/Rocketeer/Binaries/{Scm => Vcs}/Svn.php | 8 ++-- .../ScmInterface.php => Vcs/VcsInterface.php} | 8 ++-- src/Rocketeer/Services/Builders/Builder.php | 2 +- .../Config/ConfigurationDefinition.php | 4 +- .../Definition/ConnectionsDefinition.php | 4 +- .../{ScmDefinition.php => VcsDefinition.php} | 18 ++++---- .../Config/Files/ConfigurationPublisher.php | 2 +- .../Credentials/CredentialsGatherer.php | 10 ++--- .../Modules/RepositoriesKeychain.php | 6 +-- .../Connections/Shell/Modules/Binaries.php | 6 +-- .../CreateRelease/CloneStrategy.php | 14 +++---- .../Strategies/StrategiesServiceProvider.php | 12 +++--- src/Rocketeer/Tasks/Check.php | 14 +++---- src/Rocketeer/Tasks/CurrentRelease.php | 2 +- src/Rocketeer/Traits/HasLocatorTrait.php | 6 +-- src/config/config.php | 4 +- src/config/{scm.php => vcs.php} | 8 ++-- tests/Binaries/AbstractBinaryTest.php | 6 +-- tests/Binaries/{Scm => Vcs}/GitTest.php | 33 +++++++-------- tests/Binaries/{Scm => Vcs}/HgTest.php | 26 ++++++------ tests/Binaries/{Scm => Vcs}/SvnTest.php | 42 +++++++++---------- tests/RocketeerTest.php | 20 ++++----- .../Bootstrapper/BootstrapperTest.php | 12 +++--- .../Builders/Modules/BinariesBuilderTest.php | 2 +- .../Credentials/CredentialsGathererTest.php | 12 +++--- .../Modules/RepositoriesKeychainTest.php | 4 +- .../Modules/{ScmTest.php => VcsTest.php} | 2 +- tests/Strategies/Deploy/CloneStrategyTest.php | 6 +-- tests/Strategies/Deploy/SyncStrategyTest.php | 2 +- tests/Tasks/CheckTest.php | 4 +- tests/Tasks/DeployTest.php | 2 +- tests/Tasks/IgniteTest.php | 2 +- .../Modules/Mocks/ConfigurationTester.php | 18 ++++---- 36 files changed, 170 insertions(+), 171 deletions(-) rename src/Rocketeer/Binaries/{Scm => Vcs}/Git.php (91%) rename src/Rocketeer/Binaries/{Scm => Vcs}/Hg.php (93%) rename src/Rocketeer/Binaries/{Scm => Vcs}/Svn.php (94%) rename src/Rocketeer/Binaries/{Scm/ScmInterface.php => Vcs/VcsInterface.php} (89%) rename src/Rocketeer/Services/Config/Definition/{ScmDefinition.php => VcsDefinition.php} (83%) rename src/config/{scm.php => vcs.php} (84%) rename tests/Binaries/{Scm => Vcs}/GitTest.php (75%) rename tests/Binaries/{Scm => Vcs}/HgTest.php (77%) rename tests/Binaries/{Scm => Vcs}/SvnTest.php (78%) rename tests/Services/Connections/Shell/Modules/{ScmTest.php => VcsTest.php} (96%) diff --git a/src/Rocketeer/Binaries/AbstractBinary.php b/src/Rocketeer/Binaries/AbstractBinary.php index 4a003475c..d49a6a8f8 100644 --- a/src/Rocketeer/Binaries/AbstractBinary.php +++ b/src/Rocketeer/Binaries/AbstractBinary.php @@ -141,7 +141,7 @@ public function __call($name, $arguments) //////////////////////////////////////////////////////////////////// /** - * Returns a command with the SCM's binary. + * Returns a command with the VCS's binary. * * @param string|null $command * @param string|string[] $arguments diff --git a/src/Rocketeer/Binaries/Scm/Git.php b/src/Rocketeer/Binaries/Vcs/Git.php similarity index 91% rename from src/Rocketeer/Binaries/Scm/Git.php rename to src/Rocketeer/Binaries/Vcs/Git.php index 3f5c92783..12c3dd2e1 100644 --- a/src/Rocketeer/Binaries/Scm/Git.php +++ b/src/Rocketeer/Binaries/Vcs/Git.php @@ -10,14 +10,14 @@ * */ -namespace Rocketeer\Binaries\Scm; +namespace Rocketeer\Binaries\Vcs; use Rocketeer\Binaries\AbstractBinary; /** - * The Git implementation of the ScmInterface. + * The Git implementation of the VcsInterface. */ -class Git extends AbstractBinary implements ScmInterface +class Git extends AbstractBinary implements VcsInterface { /** * The core binary. @@ -31,7 +31,7 @@ class Git extends AbstractBinary implements ScmInterface //////////////////////////////////////////////////////////////////// /** - * Check if the SCM is available. + * Check if the VCS is available. * * @return string */ @@ -89,7 +89,7 @@ public function checkout($destination) // Build flags $flags = ['--branch' => $repository->branch]; - if ($this->config->getContextually('scm.shallow')) { + if ($this->config->getContextually('vcs.shallow')) { $flags['--depth'] = 1; } diff --git a/src/Rocketeer/Binaries/Scm/Hg.php b/src/Rocketeer/Binaries/Vcs/Hg.php similarity index 93% rename from src/Rocketeer/Binaries/Scm/Hg.php rename to src/Rocketeer/Binaries/Vcs/Hg.php index c4c25c61b..1ab18dfdc 100644 --- a/src/Rocketeer/Binaries/Scm/Hg.php +++ b/src/Rocketeer/Binaries/Vcs/Hg.php @@ -10,14 +10,14 @@ * */ -namespace Rocketeer\Binaries\Scm; +namespace Rocketeer\Binaries\Vcs; use Rocketeer\Binaries\AbstractBinary; /** - * The Mercury implementation of the ScmInterface. + * The Mercury implementation of the VcsInterface. */ -class Hg extends AbstractBinary implements ScmInterface +class Hg extends AbstractBinary implements VcsInterface { /** * The core binary. @@ -27,7 +27,7 @@ class Hg extends AbstractBinary implements ScmInterface protected $binary = 'hg'; /** - * Check if the SCM is available. + * Check if the VCS is available. * * @return string */ diff --git a/src/Rocketeer/Binaries/Scm/Svn.php b/src/Rocketeer/Binaries/Vcs/Svn.php similarity index 94% rename from src/Rocketeer/Binaries/Scm/Svn.php rename to src/Rocketeer/Binaries/Vcs/Svn.php index 6098a15f7..da5d9fca6 100644 --- a/src/Rocketeer/Binaries/Scm/Svn.php +++ b/src/Rocketeer/Binaries/Vcs/Svn.php @@ -10,17 +10,17 @@ * */ -namespace Rocketeer\Binaries\Scm; +namespace Rocketeer\Binaries\Vcs; use Rocketeer\Binaries\AbstractBinary; /** - * The Svn implementation of the ScmInterface. + * The Svn implementation of the VcsInterface. * * * @author Gasillo */ -class Svn extends AbstractBinary implements ScmInterface +class Svn extends AbstractBinary implements VcsInterface { /** * The core binary. @@ -34,7 +34,7 @@ class Svn extends AbstractBinary implements ScmInterface //////////////////////////////////////////////////////////////////// /** - * Check if the SCM is available. + * Check if the VCS is available. * * @return string */ diff --git a/src/Rocketeer/Binaries/Scm/ScmInterface.php b/src/Rocketeer/Binaries/Vcs/VcsInterface.php similarity index 89% rename from src/Rocketeer/Binaries/Scm/ScmInterface.php rename to src/Rocketeer/Binaries/Vcs/VcsInterface.php index 99b289221..9e1a9e854 100644 --- a/src/Rocketeer/Binaries/Scm/ScmInterface.php +++ b/src/Rocketeer/Binaries/Vcs/VcsInterface.php @@ -10,12 +10,12 @@ * */ -namespace Rocketeer\Binaries\Scm; +namespace Rocketeer\Binaries\Vcs; /** - * The interface for all SCM implementations. + * The interface for all VCS implementations. */ -interface ScmInterface +interface VcsInterface { /** * Get the current binary name. @@ -25,7 +25,7 @@ interface ScmInterface public function getBinary(); /** - * Check if the SCM is available. + * Check if the VCS is available. * * @return string */ diff --git a/src/Rocketeer/Services/Builders/Builder.php b/src/Rocketeer/Services/Builders/Builder.php index 13ce5d082..ecbfe890b 100644 --- a/src/Rocketeer/Services/Builders/Builder.php +++ b/src/Rocketeer/Services/Builders/Builder.php @@ -47,7 +47,7 @@ class Builder implements ModulableInterface, ContainerAwareInterface protected $lookups = [ 'binaries' => [ 'Rocketeer\Binaries\PackageManagers\%s', - 'Rocketeer\Binaries\Scm\%s', + 'Rocketeer\Binaries\Vcs\%s', 'Rocketeer\Binaries\%s', ], 'tasks' => [ diff --git a/src/Rocketeer/Services/Config/ConfigurationDefinition.php b/src/Rocketeer/Services/Config/ConfigurationDefinition.php index 2d46d0ee1..5a690fd57 100644 --- a/src/Rocketeer/Services/Config/ConfigurationDefinition.php +++ b/src/Rocketeer/Services/Config/ConfigurationDefinition.php @@ -18,9 +18,9 @@ use Rocketeer\Services\Config\Definition\PathsDefinition; use Rocketeer\Services\Config\Definition\PluginsDefinition; use Rocketeer\Services\Config\Definition\RemoteDefinition; -use Rocketeer\Services\Config\Definition\ScmDefinition; use Rocketeer\Services\Config\Definition\StagesDefinition; use Rocketeer\Services\Config\Definition\StrategiesDefinition; +use Rocketeer\Services\Config\Definition\VcsDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; /** @@ -36,7 +36,7 @@ class ConfigurationDefinition extends AbstractDefinition HooksDefinition::class, PathsDefinition::class, RemoteDefinition::class, - ScmDefinition::class, + VcsDefinition::class, StagesDefinition::class, StrategiesDefinition::class, PluginsDefinition::class, diff --git a/src/Rocketeer/Services/Config/Definition/ConnectionsDefinition.php b/src/Rocketeer/Services/Config/Definition/ConnectionsDefinition.php index e866805a6..87dc9563b 100644 --- a/src/Rocketeer/Services/Config/Definition/ConnectionsDefinition.php +++ b/src/Rocketeer/Services/Config/Definition/ConnectionsDefinition.php @@ -170,10 +170,10 @@ protected function getOverridesNodes(NodeBuilder $node) Per example : 'stages' => [ 'staging' => [ - 'scm' => ['branch' => 'staging'], + 'vcs' => ['branch' => 'staging'], ], 'production' => [ - 'scm' => ['branch' => 'master'], + 'vcs' => ['branch' => 'master'], ], ], EOF diff --git a/src/Rocketeer/Services/Config/Definition/ScmDefinition.php b/src/Rocketeer/Services/Config/Definition/VcsDefinition.php similarity index 83% rename from src/Rocketeer/Services/Config/Definition/ScmDefinition.php rename to src/Rocketeer/Services/Config/Definition/VcsDefinition.php index e9ef66d59..1e847cecb 100644 --- a/src/Rocketeer/Services/Config/Definition/ScmDefinition.php +++ b/src/Rocketeer/Services/Config/Definition/VcsDefinition.php @@ -15,14 +15,14 @@ use Symfony\Component\Config\Definition\TreeBuilder\NodeBuilder; /** - * Configuration schema for the SCM node. + * Configuration schema for the VCS node. */ -class ScmDefinition extends AbstractDefinition +class VcsDefinition extends AbstractDefinition { /** * @var string */ - protected $name = 'scm'; + protected $name = 'vcs'; /** * @var string @@ -50,8 +50,8 @@ protected function getChildren(NodeBuilder $node) protected function getCredentialsNodes(NodeBuilder $node) { return $node - ->enumNode('scm') - ->info('The SCM used') + ->enumNode('vcs') + ->info('The VCS used') ->values(['git', 'svn', 'hg']) ->isRequired() ->defaultValue('git') @@ -59,13 +59,13 @@ protected function getCredentialsNodes(NodeBuilder $node) ->scalarNode('repository') ->info('The SSH/HTTPS address to your repository') ->example('https://github.com/vendor/website.git') - ->defaultValue($this->value('scm.repository')) + ->defaultValue($this->value('vcs.repository')) ->end() ->scalarNode('username') - ->defaultValue($this->value('scm.username')) + ->defaultValue($this->value('vcs.username')) ->end() ->scalarNode('password') - ->defaultValue($this->value('scm.password')) + ->defaultValue($this->value('vcs.password')) ->end(); } @@ -82,7 +82,7 @@ protected function getOptionsNodes(NodeBuilder $node) ->defaultValue('master') ->end() ->scalarNode('shallow') - ->info("Whether your SCM should do a \"shallow\" clone of the repository or not - this means a clone with just the latest state of your application (no history).\nIf you're having problems cloning, try setting this to false") + ->info("Whether your VCS should do a \"shallow\" clone of the repository or not - this means a clone with just the latest state of your application (no history).\nIf you're having problems cloning, try setting this to false") ->defaultTrue() ->end() ->scalarNode('submodules') diff --git a/src/Rocketeer/Services/Config/Files/ConfigurationPublisher.php b/src/Rocketeer/Services/Config/Files/ConfigurationPublisher.php index b0313f1cc..8348bf304 100644 --- a/src/Rocketeer/Services/Config/Files/ConfigurationPublisher.php +++ b/src/Rocketeer/Services/Config/Files/ConfigurationPublisher.php @@ -96,7 +96,7 @@ public function publish($format = 'php', $consolidated = false) public function publishNode($path, $format = 'php', $node = null) { if ($this->files->isDirectory($path)) { - foreach (['config', 'hooks', 'paths', 'remote', 'scm', 'stages', 'strategies', 'plugins'] as $file) { + foreach (['config', 'hooks', 'paths', 'remote', 'vcs', 'stages', 'strategies', 'plugins'] as $file) { $this->publishNode($path.'/'.$file.'.'.$format, $format, $file); } diff --git a/src/Rocketeer/Services/Connections/Credentials/CredentialsGatherer.php b/src/Rocketeer/Services/Connections/Credentials/CredentialsGatherer.php index cf16ab735..8c989e1e1 100644 --- a/src/Rocketeer/Services/Connections/Credentials/CredentialsGatherer.php +++ b/src/Rocketeer/Services/Connections/Credentials/CredentialsGatherer.php @@ -50,10 +50,10 @@ public function getCredentials() */ public function getRepositoryCredentials() { - $endpoint = $this->scm->runLocally('currentEndpoint'); + $endpoint = $this->vcs->runLocally('currentEndpoint'); $user = $this->bash->runLocally('whoami'); - return $this->askQuestions('scm', [ + return $this->askQuestions('vcs', [ 'repository' => ['Where is your code located?', $endpoint], 'username' => ['What is the username for it?', $user], 'password' => 'And the password?', @@ -126,7 +126,7 @@ public function getConnectionCredentials($connectionName) */ protected function askQuestions($for, array $questions) { - $key = $for === 'scm' ? new RepositoryKey() : new ConnectionKey(['server' => 0]); + $key = $for === 'vcs' ? new RepositoryKey() : new ConnectionKey(['server' => 0]); $credentials = []; $config = []; @@ -148,7 +148,7 @@ protected function askQuestions($for, array $questions) } // Set in current configuration - $configKey = $for === 'scm' ? 'scm' : 'connections.'.$for; + $configKey = $for === 'vcs' ? 'vcs' : 'connections.'.$for; $this->config->set($configKey, $config); return $credentials; @@ -173,7 +173,7 @@ protected function askQuestion($for, $credential, $question) } // Get the credential, either through options or prompt - if (($for !== 'scm' || $credential === 'repository') && $option = $this->command->option($credential)) { + if (($for !== 'vcs' || $credential === 'repository') && $option = $this->command->option($credential)) { return $option; } diff --git a/src/Rocketeer/Services/Connections/Credentials/Modules/RepositoriesKeychain.php b/src/Rocketeer/Services/Connections/Credentials/Modules/RepositoriesKeychain.php index ad49269de..3780a8f01 100644 --- a/src/Rocketeer/Services/Connections/Credentials/Modules/RepositoriesKeychain.php +++ b/src/Rocketeer/Services/Connections/Credentials/Modules/RepositoriesKeychain.php @@ -42,7 +42,7 @@ public function getCurrentRepository() */ protected function getRepositoryCredentials() { - $config = (array) $this->config->getContextually('scm'); + $config = (array) $this->config->getContextually('vcs'); $credentials = (array) $this->localStorage->get('credentials'); return array_merge($config, $credentials); @@ -92,10 +92,10 @@ protected function getRepositoryBranch() } // Get branch from config, else compute the fallback - $branch = $this->config->getContextually('scm.branch'); + $branch = $this->config->getContextually('vcs.branch'); if (!$branch) { $fallback = $this->bash->on('local', function () { - return $this->scm->runSilently('currentBranch'); + return $this->vcs->runSilently('currentBranch'); }); $fallback = $fallback ?: 'master'; diff --git a/src/Rocketeer/Services/Connections/Shell/Modules/Binaries.php b/src/Rocketeer/Services/Connections/Shell/Modules/Binaries.php index d69d6524a..31c0bf3cb 100644 --- a/src/Rocketeer/Services/Connections/Shell/Modules/Binaries.php +++ b/src/Rocketeer/Services/Connections/Shell/Modules/Binaries.php @@ -21,9 +21,9 @@ * @method \Rocketeer\Binaries\PackageManagers\Npm npm() * @method \Rocketeer\Binaries\Php php() * @method \Rocketeer\Binaries\Phpunit phpunit() - * @method \Rocketeer\Binaries\Scm\Git git() - * @method \Rocketeer\Binaries\Scm\Hg hg() - * @method \Rocketeer\Binaries\Scm\Svn svn() + * @method \Rocketeer\Binaries\Vcs\Git git() + * @method \Rocketeer\Binaries\Vcs\Hg hg() + * @method \Rocketeer\Binaries\Vcs\Svn svn() */ class Binaries extends AbstractBashModule { diff --git a/src/Rocketeer/Strategies/CreateRelease/CloneStrategy.php b/src/Rocketeer/Strategies/CreateRelease/CloneStrategy.php index 62ce50f3c..dd80647bb 100644 --- a/src/Rocketeer/Strategies/CreateRelease/CloneStrategy.php +++ b/src/Rocketeer/Strategies/CreateRelease/CloneStrategy.php @@ -15,14 +15,14 @@ use Rocketeer\Strategies\AbstractStrategy; /** - * Clones a fresh instance of the repository by SCM. + * Clones a fresh instance of the repository by VCS. */ class CloneStrategy extends AbstractStrategy implements CreateReleaseStrategyInterface { /** * @var string */ - protected $description = 'Clones a fresh instance of the repository by SCM'; + protected $description = 'Clones a fresh instance of the repository by VCS'; /** * Deploy a new clean copy of the application. @@ -39,7 +39,7 @@ public function deploy($destination = null) // Executing checkout $this->explainer->line('Cloning repository in "'.$destination.'"'); - $output = $this->scm->run('checkout', $destination); + $output = $this->vcs->run('checkout', $destination); // Cancel if failed and forget credentials $success = $this->bash->displayStatusMessage('Unable to clone the repository', $output) !== false; @@ -50,9 +50,9 @@ public function deploy($destination = null) } // Deploy submodules - if ($this->config->getContextually('scm.submodules') && $this->scm->submodules()) { + if ($this->config->getContextually('vcs.submodules') && $this->vcs->submodules()) { $this->explainer->line('Initializing submodules if any'); - $this->scm->runForCurrentRelease('submodules'); + $this->vcs->runForCurrentRelease('submodules'); $success = $this->status(); } @@ -69,11 +69,11 @@ public function deploy($destination = null) public function update($reset = true) { $this->explainer->info('Pulling changes'); - $tasks = [$this->scm->update()]; + $tasks = [$this->vcs->update()]; // Reset if requested if ($reset) { - array_unshift($tasks, $this->scm->reset()); + array_unshift($tasks, $this->vcs->reset()); } return $this->bash->runForCurrentRelease($tasks); diff --git a/src/Rocketeer/Strategies/StrategiesServiceProvider.php b/src/Rocketeer/Strategies/StrategiesServiceProvider.php index 965a1e192..9bbb00147 100644 --- a/src/Rocketeer/Strategies/StrategiesServiceProvider.php +++ b/src/Rocketeer/Strategies/StrategiesServiceProvider.php @@ -13,7 +13,7 @@ namespace Rocketeer\Strategies; use League\Container\ServiceProvider\AbstractServiceProvider; -use Rocketeer\Binaries\Scm\ScmInterface; +use Rocketeer\Binaries\Vcs\VcsInterface; use Rocketeer\Services\Builders\Builder; use Rocketeer\Services\Config\ContextualConfiguration; @@ -23,7 +23,7 @@ class StrategiesServiceProvider extends AbstractServiceProvider * @var array */ protected $provides = [ - ScmInterface::class, + VcsInterface::class, ]; /** @@ -34,10 +34,10 @@ public function register() /** @var ContextualConfiguration $config */ $config = $this->container->get(ContextualConfiguration::class); - // Bind SCM class - $scm = $config->getContextually('scm.scm'); - $this->container->add(ScmInterface::class, function () use ($scm) { - return $this->container->get(Builder::class)->buildBinary($scm); + // Bind VCS class + $vcs = $config->getContextually('vcs.vcs'); + $this->container->add(VcsInterface::class, function () use ($vcs) { + return $this->container->get(Builder::class)->buildBinary($vcs); }); } } diff --git a/src/Rocketeer/Tasks/Check.php b/src/Rocketeer/Tasks/Check.php index 208d61f25..2ee843c59 100644 --- a/src/Rocketeer/Tasks/Check.php +++ b/src/Rocketeer/Tasks/Check.php @@ -36,7 +36,7 @@ class Check extends AbstractTask */ public function execute() { - $this->steps()->checkScm(); + $this->steps()->checkVcs(); if ($this->getStrategy('Check')) { $this->steps()->checkManagerMethod('language', 'Checking presence of language'); $this->steps()->checkManagerMethod('manager', 'Checking presence of package manager'); @@ -56,24 +56,24 @@ public function execute() //////////////////////////////////////////////////////////////////// /** - * Check the presence of an SCM on the server. + * Check the presence of an VCS on the server. * * @return bool */ - public function checkScm() + public function checkVcs() { - // Cancel if not using any SCM + // Cancel if not using any VCS if (strtolower($this->config->getContextually('strategies.create-release')) !== 'clone') { return true; } - $this->explainer->line('Checking presence of '.$this->scm->getBinary()); - $results = $this->scm->run('check'); + $this->explainer->line('Checking presence of '.$this->vcs->getBinary()); + $results = $this->vcs->run('check'); $this->toOutput($results); $isPresent = $this->status(); if (!$isPresent) { - $this->explainer->error($this->scm->getBinary().' could not be found'); + $this->explainer->error($this->vcs->getBinary().' could not be found'); } return $isPresent; diff --git a/src/Rocketeer/Tasks/CurrentRelease.php b/src/Rocketeer/Tasks/CurrentRelease.php index 6fa0f8711..08edf7bc9 100644 --- a/src/Rocketeer/Tasks/CurrentRelease.php +++ b/src/Rocketeer/Tasks/CurrentRelease.php @@ -50,7 +50,7 @@ public function execute() // Create state message $date = DateTime::createFromFormat('YmdHis', $currentRelease)->format('Y-m-d H:i:s'); - $state = $this->runForCurrentRelease($this->scm->currentState()); + $state = $this->runForCurrentRelease($this->vcs->currentState()); $message = sprintf( 'The current release'.$stage.' is %s (%s deployed at %s)', $currentRelease, diff --git a/src/Rocketeer/Traits/HasLocatorTrait.php b/src/Rocketeer/Traits/HasLocatorTrait.php index a082bca44..efe554c0f 100644 --- a/src/Rocketeer/Traits/HasLocatorTrait.php +++ b/src/Rocketeer/Traits/HasLocatorTrait.php @@ -14,7 +14,7 @@ use Illuminate\Support\Arr; use League\Event\Emitter; -use Rocketeer\Binaries\Scm\ScmInterface; +use Rocketeer\Binaries\Vcs\VcsInterface; use Rocketeer\Console\Commands\AbstractCommand; use Rocketeer\Console\Console; use Rocketeer\Rocketeer; @@ -78,7 +78,7 @@ * @property Rocketeer rocketeer * @property RocketeerIgniter igniter * @property RolesManager roles - * @property ScmInterface scm + * @property VcsInterface vcs * @property Storage localStorage * @property Storage remoteStorage * @property TasksHandler tasks @@ -146,9 +146,9 @@ protected function getLocatorHandle($key) 'remoteStorage' => 'storage.remote', 'rocketeer' => Rocketeer::class, 'roles' => RolesManager::class, - 'scm' => ScmInterface::class, 'tasks' => TasksHandler::class, 'timer' => QueueTimer::class, + 'vcs' => VcsInterface::class, ]; // Replace shortcuts diff --git a/src/config/config.php b/src/config/config.php index 7b1277911..1b8a2f617 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -34,10 +34,10 @@ // Per example : // 'stages' => [ // 'staging' => [ - // 'scm' => ['branch' => 'staging'], + // 'vcs' => ['branch' => 'staging'], // ], // 'production' => [ - // 'scm' => ['branch' => 'master'], + // 'vcs' => ['branch' => 'master'], // ], // ], 'on' => [ diff --git a/src/config/scm.php b/src/config/vcs.php similarity index 84% rename from src/config/scm.php rename to src/config/vcs.php index f09253c5c..265f116c8 100644 --- a/src/config/scm.php +++ b/src/config/vcs.php @@ -14,10 +14,10 @@ // The configuration of your repository ////////////////////////////////////////////////////////////////////// - 'scm' => [ + 'vcs' => [ - // The SCM used - 'scm' => 'git', // One of "git", "svn", "hg", Required + // The VCS used + 'vcs' => 'git', // One of "git", "svn", "hg", Required // The SSH/HTTPS address to your repository 'repository' => null, // Example: https://github.com/vendor/website.git @@ -27,7 +27,7 @@ // The branch to deploy 'branch' => 'master', - // Whether your SCM should do a "shallow" clone of the repository or not - this means a clone with just the latest state of your application (no history). + // Whether your VCS should do a "shallow" clone of the repository or not - this means a clone with just the latest state of your application (no history). // If you're having problems cloning, try setting this to false 'shallow' => true, diff --git a/tests/Binaries/AbstractBinaryTest.php b/tests/Binaries/AbstractBinaryTest.php index 2261ad29f..ab3f5ccef 100644 --- a/tests/Binaries/AbstractBinaryTest.php +++ b/tests/Binaries/AbstractBinaryTest.php @@ -14,7 +14,7 @@ use Prophecy\Argument; use Rocketeer\Binaries\PackageManagers\Composer; -use Rocketeer\Binaries\Scm\Git; +use Rocketeer\Binaries\Vcs\Git; use Rocketeer\Services\Connections\Shell\Bash; use Rocketeer\Services\Releases\ReleasesManager; use Rocketeer\TestCases\RocketeerTestCase; @@ -29,8 +29,8 @@ public function testCanExecuteMethod() return $arguments; }); - $scm = new Git($this->container); - $command = $scm->run('checkout', $this->server); + $vcs = new Git($this->container); + $command = $vcs->run('checkout', $this->server); $expected = $this->replaceHistoryPlaceholders(['git clone "{repository}" "{server}" --branch="master" --depth="1"']); $this->assertEquals($expected, $command); diff --git a/tests/Binaries/Scm/GitTest.php b/tests/Binaries/Vcs/GitTest.php similarity index 75% rename from tests/Binaries/Scm/GitTest.php rename to tests/Binaries/Vcs/GitTest.php index 1688c6479..4b141656b 100644 --- a/tests/Binaries/Scm/GitTest.php +++ b/tests/Binaries/Vcs/GitTest.php @@ -10,25 +10,25 @@ * */ -namespace Rocketeer\Scm; +namespace Rocketeer\Vcs; -use Rocketeer\Binaries\Scm\Git; +use Rocketeer\Binaries\Vcs\Git; use Rocketeer\TestCases\RocketeerTestCase; class GitTest extends RocketeerTestCase { /** - * The current SCM instance. + * The current VCS instance. * * @var Git */ - protected $scm; + protected $vcs; public function setUp() { parent::setUp(); - $this->scm = new Git($this->container); + $this->vcs = new Git($this->container); } //////////////////////////////////////////////////////////////////// @@ -37,69 +37,68 @@ public function setUp() public function testCanGetCheck() { - $command = $this->scm->check(); + $command = $this->vcs->check(); $this->assertEquals('git --version', $command); } public function testCanGetCurrentState() { - $command = $this->scm->currentState(); + $command = $this->vcs->currentState(); $this->assertEquals('git rev-parse HEAD', $command); } public function testCanGetCurrentBranch() { - $command = $this->scm->currentBranch(); + $command = $this->vcs->currentBranch(); $this->assertEquals('git rev-parse --abbrev-ref HEAD', $command); } public function testCanGetCheckout() { - $this->swapScmConfiguration([ + $this->swapVcsConfiguration([ 'shallow' => true, 'repository' => 'http://github.com/my/repository', 'branch' => 'develop', ]); - $command = $this->scm->checkout($this->server); + $command = $this->vcs->checkout($this->server); $this->assertEquals('git clone "http://github.com/my/repository" "'.$this->server.'" --branch="develop" --depth="1"', $command); } public function testCanGetDeepClone() { - $this->config->set('scm.shallow', false); - - $this->swapScmConfiguration([ + $this->config->set('vcs.shallow', false); + $this->swapVcsConfiguration([ 'repository' => 'http://github.com/my/repository', 'branch' => 'develop', ]); - $command = $this->scm->checkout($this->server); + $command = $this->vcs->checkout($this->server); $this->assertEquals('git clone "http://github.com/my/repository" "'.$this->server.'" --branch="develop"', $command); } public function testCanGetReset() { - $command = $this->scm->reset(); + $command = $this->vcs->reset(); $this->assertEquals('git reset --hard', $command); } public function testCanGetUpdate() { - $command = $this->scm->update(); + $command = $this->vcs->update(); $this->assertEquals('git pull --recurse-submodules', $command); } public function testCanGetSubmodules() { - $command = $this->scm->submodules(); + $command = $this->vcs->submodules(); $this->assertEquals('git submodule update --init --recursive', $command); } diff --git a/tests/Binaries/Scm/HgTest.php b/tests/Binaries/Vcs/HgTest.php similarity index 77% rename from tests/Binaries/Scm/HgTest.php rename to tests/Binaries/Vcs/HgTest.php index 948436f2c..6ad9f0ab8 100644 --- a/tests/Binaries/Scm/HgTest.php +++ b/tests/Binaries/Vcs/HgTest.php @@ -10,25 +10,25 @@ * */ -namespace Rocketeer\Scm; +namespace Rocketeer\Vcs; -use Rocketeer\Binaries\Scm\Hg; +use Rocketeer\Binaries\Vcs\Hg; use Rocketeer\TestCases\RocketeerTestCase; class HgTest extends RocketeerTestCase { /** - * The current SCM instance. + * The current VCS instance. * * @var Hg */ - protected $scm; + protected $vcs; public function setUp() { parent::setUp(); - $this->scm = new Hg($this->container); + $this->vcs = new Hg($this->container); } //////////////////////////////////////////////////////////////////// @@ -37,56 +37,56 @@ public function setUp() public function testCanGetCheck() { - $command = $this->scm->check(); + $command = $this->vcs->check(); $this->assertEquals('hg --version', $command); } public function testCanGetCurrentState() { - $command = $this->scm->currentState(); + $command = $this->vcs->currentState(); $this->assertEquals('hg identify -i', $command); } public function testCanGetCurrentBranch() { - $command = $this->scm->currentBranch(); + $command = $this->vcs->currentBranch(); $this->assertEquals('hg branch', $command); } public function testCanGetCheckout() { - $this->swapScmConfiguration([ + $this->swapVcsConfiguration([ 'username' => 'foo', 'password' => 'bar', 'repository' => 'http://github.com/my/repository', 'branch' => 'develop', ]); - $command = $this->scm->checkout($this->server); + $command = $this->vcs->checkout($this->server); $this->assertEquals('hg clone "http://github.com/my/repository" -b develop "'.$this->server.'" --config ui.interactive="no" --config auth.x.prefix="http://" --config auth.x.username="foo" --config auth.x.password="bar"', $command); } public function testCanGetReset() { - $command = $this->scm->reset(); + $command = $this->vcs->reset(); $this->assertEquals('hg update --clean', $command); } public function testCanGetUpdate() { - $command = $this->scm->update(); + $command = $this->vcs->update(); $this->assertEquals('hg pull', $command); } public function testCanGetSubmodules() { - $command = $this->scm->submodules(); + $command = $this->vcs->submodules(); $this->assertEmpty($command); } diff --git a/tests/Binaries/Scm/SvnTest.php b/tests/Binaries/Vcs/SvnTest.php similarity index 78% rename from tests/Binaries/Scm/SvnTest.php rename to tests/Binaries/Vcs/SvnTest.php index 9c7df15d2..de3243456 100644 --- a/tests/Binaries/Scm/SvnTest.php +++ b/tests/Binaries/Vcs/SvnTest.php @@ -10,25 +10,25 @@ * */ -namespace Rocketeer\Scm; +namespace Rocketeer\Vcs; -use Rocketeer\Binaries\Scm\Svn; +use Rocketeer\Binaries\Vcs\Svn; use Rocketeer\TestCases\RocketeerTestCase; class SvnTest extends RocketeerTestCase { /** - * The current SCM instance. + * The current VCS instance. * * @var Svn */ - protected $scm; + protected $vcs; public function setUp() { parent::setUp(); - $this->scm = new Svn($this->container); + $this->vcs = new Svn($this->container); } //////////////////////////////////////////////////////////////////// @@ -37,109 +37,109 @@ public function setUp() public function testCanGetCheck() { - $command = $this->scm->check(); + $command = $this->vcs->check(); $this->assertEquals('svn --version', $command); } public function testCanGetCurrentState() { - $command = $this->scm->currentState(); + $command = $this->vcs->currentState(); $this->assertEquals('svn info | grep "Revision"', $command); } public function testCanGetCurrentBranch() { - $command = $this->scm->currentBranch(); + $command = $this->vcs->currentBranch(); $this->assertEquals('echo trunk', $command); } public function testCanGetCheckout() { - $this->swapScmConfiguration([ + $this->swapVcsConfiguration([ 'username' => 'foo', 'password' => 'bar', 'repository' => 'http://github.com/my/repository', 'branch' => 'develop', ]); - $command = $this->scm->checkout($this->server); + $command = $this->vcs->checkout($this->server); $this->assertEquals('svn co http://github.com/my/repository/develop '.$this->server.' --non-interactive --username="foo" --password="bar"', $command); } public function testCanGetDeepClone() { - $this->swapScmConfiguration([ + $this->swapVcsConfiguration([ 'username' => 'foo', 'password' => 'bar', 'repository' => 'http://github.com/my/repository', 'branch' => 'develop', ]); - $command = $this->scm->checkout($this->server); + $command = $this->vcs->checkout($this->server); $this->assertEquals('svn co http://github.com/my/repository/develop '.$this->server.' --non-interactive --username="foo" --password="bar"', $command); } public function testDoesntDuplicateCredentials() { - $this->swapScmConfiguration([ + $this->swapVcsConfiguration([ 'username' => 'foo', 'password' => 'bar', 'repository' => 'http://foo:bar@github.com/my/repository', 'branch' => 'develop', ]); - $command = $this->scm->checkout($this->server); + $command = $this->vcs->checkout($this->server); $this->assertEquals('svn co http://github.com/my/repository/develop '.$this->server.' --non-interactive --username="foo" --password="bar"', $command); - $this->swapScmConfiguration([ + $this->swapVcsConfiguration([ 'username' => 'foo', 'password' => null, 'repository' => 'http://foo@github.com/my/repository', 'branch' => 'develop', ]); - $command = $this->scm->checkout($this->server); + $command = $this->vcs->checkout($this->server); $this->assertEquals('svn co http://github.com/my/repository/develop '.$this->server.' --non-interactive --username="foo"', $command); } public function testDoesntStripRevisionFromUrl() { - $this->swapScmConfiguration([ + $this->swapVcsConfiguration([ 'username' => 'foo', 'password' => 'bar', 'repository' => 'url://user:login@example.com/test', 'branch' => 'trunk@1234', ]); - $command = $this->scm->checkout($this->server); + $command = $this->vcs->checkout($this->server); $this->assertEquals('svn co url://example.com/test/trunk@1234 '.$this->server.' --non-interactive --username="foo" --password="bar"', $command); } public function testCanGetReset() { - $command = $this->scm->reset(); + $command = $this->vcs->reset(); $this->assertEquals("svn status -q | grep -v '^[~XI ]' | awk '{print $2;}' | xargs --no-run-if-empty svn revert", $command); } public function testCanGetUpdate() { - $command = $this->scm->update(); + $command = $this->vcs->update(); $this->assertEquals('svn up --non-interactive', $command); } public function testCanGetSubmodules() { - $command = $this->scm->submodules(); + $command = $this->vcs->submodules(); $this->assertEmpty($command); } diff --git a/tests/RocketeerTest.php b/tests/RocketeerTest.php index 1b3a69453..a1117b0cf 100644 --- a/tests/RocketeerTest.php +++ b/tests/RocketeerTest.php @@ -19,30 +19,30 @@ class RocketeerTest extends RocketeerTestCase public function testCanUseRecursiveStageConfiguration() { $this->swapConfig([ - 'scm.branch' => 'master', - 'on.stages.staging.scm.branch' => 'staging', + 'vcs.branch' => 'master', + 'on.stages.staging.vcs.branch' => 'staging', ]); - $this->assertOptionValueEquals('master', 'scm.branch'); + $this->assertOptionValueEquals('master', 'vcs.branch'); $this->connections->setStage('staging'); - $this->assertOptionValueEquals('staging', 'scm.branch'); + $this->assertOptionValueEquals('staging', 'vcs.branch'); } public function testCanUseRecursiveConnectionConfiguration() { $this->swapConfig([ 'default' => 'production', - 'scm.branch' => 'master', - 'on.connections.staging.scm.branch' => 'staging', + 'vcs.branch' => 'master', + 'on.connections.staging.vcs.branch' => 'staging', ]); - $this->assertOptionValueEquals('master', 'scm.branch'); + $this->assertOptionValueEquals('master', 'vcs.branch'); $this->swapConfig([ 'default' => 'staging', - 'scm.branch' => 'master', - 'on.connections.staging.scm.branch' => 'staging', + 'vcs.branch' => 'master', + 'on.connections.staging.vcs.branch' => 'staging', ]); - $this->assertOptionValueEquals('staging', 'scm.branch'); + $this->assertOptionValueEquals('staging', 'vcs.branch'); } public function testRocketeerCanGuessWhichStageHesIn() diff --git a/tests/Services/Bootstrapper/BootstrapperTest.php b/tests/Services/Bootstrapper/BootstrapperTest.php index 93dc356ea..acf79eb3a 100644 --- a/tests/Services/Bootstrapper/BootstrapperTest.php +++ b/tests/Services/Bootstrapper/BootstrapperTest.php @@ -50,11 +50,11 @@ public function testCanUseFilesAndFoldersForContextualConfig() $this->swapConfigWithEvents(); $folder = $this->replicateConfiguration(); - $file = $folder.'/connections/production/scm.php'; - $this->files->write($file, ' "svn"];'); + $file = $folder.'/connections/production/vcs.php'; + $this->files->write($file, ' "svn"];'); $this->bootstrapper->bootstrapConfiguration(); - $this->assertEquals('svn', $this->config->getContextually('scm.scm')); + $this->assertEquals('svn', $this->config->getContextually('vcs.vcs')); } public function testCanUseFilesAndFoldersForPluginsConfig() @@ -82,11 +82,11 @@ public function testCanLoadDotenvFiles() $config = $this->replicateConfiguration(); $path = $this->paths->getDotenvPath(); - $this->files->put($path, 'SCM_REPOSITORY=foobar'); - $this->files->put($config.'/scm.php', ' ["scm" => "git", "repository" => "%%SCM_REPOSITORY%%"]];'); + $this->files->put($path, 'VCS_REPOSITORY=foobar'); + $this->files->put($config.'/vcs.php', ' ["vcs" => "git", "repository" => "%%VCS_REPOSITORY%%"]];'); $this->bootstrapper->bootstrapConfiguration(); - $this->assertEquals('foobar', $this->config->get('scm.repository')); + $this->assertEquals('foobar', $this->config->get('vcs.repository')); } } diff --git a/tests/Services/Builders/Modules/BinariesBuilderTest.php b/tests/Services/Builders/Modules/BinariesBuilderTest.php index cef1a2c3f..2cda848b9 100644 --- a/tests/Services/Builders/Modules/BinariesBuilderTest.php +++ b/tests/Services/Builders/Modules/BinariesBuilderTest.php @@ -13,7 +13,7 @@ namespace Rocketeer\Services\Builders\Modules; use Rocketeer\Binaries\AnonymousBinary; -use Rocketeer\Binaries\Scm\Git; +use Rocketeer\Binaries\Vcs\Git; use Rocketeer\TestCases\RocketeerTestCase; class BinariesBuilderTest extends RocketeerTestCase diff --git a/tests/Services/Connections/Credentials/CredentialsGathererTest.php b/tests/Services/Connections/Credentials/CredentialsGathererTest.php index 7d9f5d07b..ab8cb83e3 100644 --- a/tests/Services/Connections/Credentials/CredentialsGathererTest.php +++ b/tests/Services/Connections/Credentials/CredentialsGathererTest.php @@ -18,7 +18,7 @@ class CredentialsGathererTest extends RocketeerTestCase { public function testCanGetRepositoryCredentials() { - $this->swapScmConfiguration([]); + $this->swapVcsConfiguration([]); $this->mockAnswers([ 'Where is your code' => 'https://'.$this->repository, 'username' => $this->username, @@ -27,22 +27,22 @@ public function testCanGetRepositoryCredentials() $credentials = $this->credentialsGatherer->getRepositoryCredentials(); $this->assertEquals([ - 'SCM_REPOSITORY' => 'https://'.$this->repository, - 'SCM_USERNAME' => $this->username, - 'SCM_PASSWORD' => $this->password, + 'VCS_REPOSITORY' => 'https://'.$this->repository, + 'VCS_USERNAME' => $this->username, + 'VCS_PASSWORD' => $this->password, ], $credentials); } public function testDoesntAskForRepositoryCredentialsIfUneeded() { - $this->swapScmConfiguration([]); + $this->swapVcsConfiguration([]); $this->mockAnswers([ 'Where is' => $this->repository, ]); $credentials = $this->credentialsGatherer->getRepositoryCredentials(); $this->assertEquals([ - 'SCM_REPOSITORY' => $this->repository, + 'VCS_REPOSITORY' => $this->repository, ], $credentials); } diff --git a/tests/Services/Connections/Credentials/Modules/RepositoriesKeychainTest.php b/tests/Services/Connections/Credentials/Modules/RepositoriesKeychainTest.php index ff377dbdc..6e77c024c 100644 --- a/tests/Services/Connections/Credentials/Modules/RepositoriesKeychainTest.php +++ b/tests/Services/Connections/Credentials/Modules/RepositoriesKeychainTest.php @@ -79,7 +79,7 @@ public function testCangetRepositoryBranch() public function testCanExtractCurrentBranchIfNoneSpecified() { - $this->config->set('scm.branch', null); + $this->config->set('vcs.branch', null); $prophecy = $this->bindProphecy(Bash::class); $prophecy->on('local', Argument::any())->willReturn(' foobar '); @@ -89,7 +89,7 @@ public function testCanExtractCurrentBranchIfNoneSpecified() public function testCanDefaultToMasterIfNoBranchFound() { - $this->config->set('scm.branch', null); + $this->config->set('vcs.branch', null); $prophecy = $this->bindProphecy(Bash::class); $prophecy->on('local', Argument::any())->willReturn(null); diff --git a/tests/Services/Connections/Shell/Modules/ScmTest.php b/tests/Services/Connections/Shell/Modules/VcsTest.php similarity index 96% rename from tests/Services/Connections/Shell/Modules/ScmTest.php rename to tests/Services/Connections/Shell/Modules/VcsTest.php index bfa222480..127c87628 100644 --- a/tests/Services/Connections/Shell/Modules/ScmTest.php +++ b/tests/Services/Connections/Shell/Modules/VcsTest.php @@ -16,7 +16,7 @@ use Rocketeer\Services\Connections\Shell\Bash; use Rocketeer\TestCases\RocketeerTestCase; -class ScmTest extends RocketeerTestCase +class VcsTest extends RocketeerTestCase { public function testCanForgetCredentialsIfInvalid() { diff --git a/tests/Strategies/Deploy/CloneStrategyTest.php b/tests/Strategies/Deploy/CloneStrategyTest.php index 9ae49df0c..822619120 100644 --- a/tests/Strategies/Deploy/CloneStrategyTest.php +++ b/tests/Strategies/Deploy/CloneStrategyTest.php @@ -12,8 +12,8 @@ namespace Rocketeer\Strategies\CreateRelease; -use Rocketeer\Binaries\Scm\ScmInterface; -use Rocketeer\Binaries\Scm\Svn; +use Rocketeer\Binaries\Vcs\Svn; +use Rocketeer\Binaries\Vcs\VcsInterface; use Rocketeer\TestCases\RocketeerTestCase; class CloneStrategyTest extends RocketeerTestCase @@ -52,7 +52,7 @@ public function testCanUpdateRepository() public function testDoesntRunSubmodulesCheckoutForSvn() { - $this->container->add(ScmInterface::class, new Svn($this->container)); + $this->container->add(VcsInterface::class, new Svn($this->container)); $task = $this->pretendTask('Deploy'); $task->getStrategy('CreateRelease')->deploy(); diff --git a/tests/Strategies/Deploy/SyncStrategyTest.php b/tests/Strategies/Deploy/SyncStrategyTest.php index 74a751f33..8062867a8 100644 --- a/tests/Strategies/Deploy/SyncStrategyTest.php +++ b/tests/Strategies/Deploy/SyncStrategyTest.php @@ -23,7 +23,7 @@ public function setUp() $this->swapConfigWithEvents([ 'hooks' => [], - 'scm.submodules' => false, + 'vcs.submodules' => false, 'strategies.deploy' => 'Sync', 'connections' => [ 'production' => [ diff --git a/tests/Tasks/CheckTest.php b/tests/Tasks/CheckTest.php index 2cc3462ff..6c9a6fbc2 100644 --- a/tests/Tasks/CheckTest.php +++ b/tests/Tasks/CheckTest.php @@ -18,7 +18,7 @@ class CheckTest extends RocketeerTestCase { - public function testCanCheckScmVersionIfRequired() + public function testCanCheckVcsVersionIfRequired() { $this->usesComposer(); @@ -27,7 +27,7 @@ public function testCanCheckScmVersionIfRequired() ]); } - public function testSkipsScmCheckIfNotRequired() + public function testSkipsVcsCheckIfNotRequired() { $this->usesComposer(); diff --git a/tests/Tasks/DeployTest.php b/tests/Tasks/DeployTest.php index 18245696e..4d36d485a 100644 --- a/tests/Tasks/DeployTest.php +++ b/tests/Tasks/DeployTest.php @@ -82,7 +82,7 @@ public function testStepsRunnerDoesntCancelWithPermissionsAndShared() public function testCanDisableGitOptions() { - $this->swapScmConfiguration([ + $this->swapVcsConfiguration([ 'shallow' => false, 'submodules' => false, ]); diff --git a/tests/Tasks/IgniteTest.php b/tests/Tasks/IgniteTest.php index e4cbaca1f..c98022db6 100644 --- a/tests/Tasks/IgniteTest.php +++ b/tests/Tasks/IgniteTest.php @@ -46,7 +46,7 @@ public function testCanIgniteConfiguration() $this->assertContains("'application_name' => 'foobar'", $config); $this->assertContains('FOO=bar', $dotenv); - $this->assertContains('SCM_REPOSITORY=git@github.com/rocketeers/website.git', $dotenv); + $this->assertContains('VCS_REPOSITORY=git@github.com/rocketeers/website.git', $dotenv); } public function testCanIgniteStubs() diff --git a/tests/TestCases/Modules/Mocks/ConfigurationTester.php b/tests/TestCases/Modules/Mocks/ConfigurationTester.php index 96b69bf62..a51681852 100644 --- a/tests/TestCases/Modules/Mocks/ConfigurationTester.php +++ b/tests/TestCases/Modules/Mocks/ConfigurationTester.php @@ -32,7 +32,7 @@ protected function getFactoryConfiguration() // Base the mocked configuration off the factory values $defaults = []; - $files = ['config', 'hooks', 'paths', 'remote', 'scm', 'stages', 'strategies']; + $files = ['config', 'hooks', 'paths', 'remote', 'vcs', 'stages', 'strategies']; foreach ($files as $file) { $defaults[$file] = $this->config->get($file); } @@ -71,8 +71,8 @@ protected function getFactoryConfiguration() 'remote.permissions.files' => ['tests'], 'remote.shared' => ['tests/Elements'], 'remote.keep_releases' => 1, - 'scm' => [ - 'scm' => 'git', + 'vcs' => [ + 'vcs' => 'git', 'branch' => 'master', 'repository' => 'https://github.com/'.$this->repository, 'shallow' => true, @@ -169,16 +169,16 @@ protected function swapConnections(array $connections) /** * @param array $credentials */ - protected function swapScmConfiguration(array $credentials) + protected function swapVcsConfiguration(array $credentials) { - $scm = $this->config->get('scm'); - $scm = array_merge($scm, $credentials); + $vcs = $this->config->get('vcs'); + $vcs = array_merge($vcs, $credentials); - $this->config->set('scm', $scm); + $this->config->set('vcs', $vcs); } /** - * Make the config return specific SCM config. + * Make the config return specific VCS config. * * @param string $repository * @param string|null $username @@ -186,7 +186,7 @@ protected function swapScmConfiguration(array $credentials) */ protected function swapRepositoryConfiguration($repository, $username = null, $password = null) { - $this->swapScmConfiguration([ + $this->swapVcsConfiguration([ 'repository' => $repository, 'username' => $username, 'password' => $password,