Skip to content

Commit

Permalink
GL-2368: Added node specific ciPath for node project. (#1709)
Browse files Browse the repository at this point in the history
* GL-2368: Added node specific ciPath for node project.

* GL-2368: Updated shell command and added testcases for it.

* GL-2368: Updated binary check for curl.

* GL-2368: Added mock for curl command.

* use gitlab-php-client

---------

Co-authored-by: acquia-service-acc-user <[email protected]>
Co-authored-by: Dane Powell <[email protected]>
  • Loading branch information
3 people authored Apr 1, 2024
1 parent 3af089e commit a1f59d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Command/CodeStudio/CodeStudioWizardCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->setGitLabCiCdVariablesForPhpProject($project, $appUuid, $cloudKey, $cloudSecret, $projectAccessTokenName, $projectAccessToken, $phpVersion);
break;
case "Node_project":
$parameters = [
'ci_config_path' => 'gitlab-ci/Auto-DevOps.acquia.gitlab-ci.yml@acquia/node-template',
];
$client = $this->getGitLabClient();
$client->projects()->update($project['id'], $parameters);
$this->setGitLabCiCdVariablesForNodeProject($project, $appUuid, $cloudKey, $cloudSecret, $projectAccessTokenName, $projectAccessToken, $nodeVersion);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,13 @@ public function testCommand(array $mockedGitlabProjects, array $inputs, array $a
Argument::type('string'),
)->shouldBeCalled();
$this->mockGitLabVariables($this->gitLabProjectId, $projects);

if ($inputs[0] === 'y' && ($inputs[1] === '1' || (array_key_exists(3, $inputs) && $inputs[3] === '1'))) {
$parameters = [
'ci_config_path' => 'gitlab-ci/Auto-DevOps.acquia.gitlab-ci.yml@acquia/node-template',
];
$projects->update($this->gitLabProjectId, $parameters)->shouldBeCalled();
}
$schedules = $this->prophet->prophesize(Schedules::class);
$schedules->showAll($this->gitLabProjectId)->willReturn([]);
$pipeline = ['id' => 1];
Expand Down

0 comments on commit a1f59d3

Please sign in to comment.