Skip to content

Commit

Permalink
Adding push.artifact.destination_git_urls. acquia cli config.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshirohit100 committed Sep 4, 2024
1 parent c072606 commit 3a5e367
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Command/Push/PushArtifactCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ private function determineDestinationGitUrls(?string $applicationUuid): array
if ($envVar = getenv('ACLI_PUSH_ARTIFACT_DESTINATION_GIT_URLS')) {
return explode(',', $envVar);
}
if ($this->datastoreAcli->get('push.artifact.destination-git-urls')) {
return $this->datastoreAcli->get('push.artifact.destination-git-urls');
if ($this->datastoreAcli->get('push.artifact.destination_git_urls')) {
return $this->datastoreAcli->get('push.artifact.destination_git_urls');
}

return [$this->getAnyVcsUrl($applicationUuid)];
Expand Down
18 changes: 14 additions & 4 deletions src/Config/AcquiaCliConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,20 @@ public function getConfigTreeBuilder(): TreeBuilder
$treeBuilder = new TreeBuilder('acquia_cli');
$treeBuilder
->getRootNode()
->children()
->scalarNode('cloud_app_uuid')
->end()
->end();
->children()
->scalarNode('cloud_app_uuid')->end()
->arrayNode('push')
->children()
->arrayNode('artifact')
->children()
->arrayNode('destination_git_urls')
->scalarPrototype()->end()
->end()
->end()
->end()
->end()
->end()
->end();
return $treeBuilder;
}
}
4 changes: 2 additions & 2 deletions tests/phpunit/src/Commands/Push/PushArtifactCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ public function testPushArtifactWithAcquiaCliFile(): void
$applications = $this->mockRequest('getApplications');
$this->mockRequest('getApplicationByUuid', $applications[0]->uuid);
$this->mockRequest('getApplicationEnvironments', $applications[0]->uuid);
$this->datastoreAcli->set('push.artifact.destination-git-urls', [
$this->datastoreAcli->set('push.artifact.destination_git_urls', [
'https://github.com/example1/cli.git',
'https://github.com/example2/cli.git',
]);
$localMachineHelper = $this->mockLocalMachineHelper();
$this->setUpPushArtifact($localMachineHelper, 'master', $this->datastoreAcli->get('push.artifact.destination-git-urls'));
$this->setUpPushArtifact($localMachineHelper, 'master', $this->datastoreAcli->get('push.artifact.destination_git_urls'));
$this->executeCommand([
'--destination-git-branch' => 'master',
]);
Expand Down

0 comments on commit 3a5e367

Please sign in to comment.