Skip to content

Commit

Permalink
RCAT-572 : Run ACMS commands in ORCA fixture creation
Browse files Browse the repository at this point in the history
  • Loading branch information
mayur-sose committed Dec 2, 2024
1 parent e0be1fc commit 7e35cff
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/ci/_includes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export DRUPAL_TEST_WEBDRIVER_CHROME_ARGS="--disable-gpu --headless --no-sandbox"
export DRUPAL_TEST_WEBDRIVER_HOSTNAME="localhost"
export DRUPAL_TEST_WEBDRIVER_PORT="4444"
export DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY=../../
export SITESTUDIO_API_KEY="key-cohesion-baseline"
export SITESTUDIO_ORG_KEY="test-cohesion-baseline"

if [[ "$GITLAB_CI" ]]; then
# In Gitlab we are using a separate container to run ChromeDriver on port 9515.
Expand Down
13 changes: 13 additions & 0 deletions src/Domain/Fixture/FixtureCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ public function create(FixtureOptions $options): void {
$this->installSite();
$this->setUpFilesDirectories();
$this->customizeFixture();
$this->runAcmsCommands();
$this->createAndCheckoutBackupTag();
$this->displaySecurityVulnerabilityAdvisories();
$this->displayStatus();
Expand Down Expand Up @@ -978,4 +979,16 @@ private function displaySecurityVulnerabilityAdvisories(): void {
}
}

/**
* Runs ACMS commands.
*/
public function runAcmsCommands(): void {
// if ($this->fixtureInspector->getInstalledPackageVersionPretty('acquia/acquia_cms') === '~') {
// return;
// }
$this->output->section('Run ACMS Site Build');
$this->processRunner->runFixtureVendorBin(['acms', 'acms:build', 'acquia_cms_community', '--no-interaction']);
$this->output->section('Run ACMS Site Install');
$this->processRunner->runFixtureVendorBin(['acms', 'site:install', 'acquia_cms_community', '--no-interaction']);
}
}
8 changes: 8 additions & 0 deletions src/Enum/EnvVarEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
* @method static EnvVarEnum DRUPAL_TEST_WEBDRIVER_CHROME_ARGS()
* @method static EnvVarEnum DRUPAL_TEST_WEBDRIVER_HOSTNAME()
* @method static EnvVarEnum DRUPAL_TEST_WEBDRIVER_PORT()
* @method static EnvVarEnum SITESTUDIO_API_KEY()
* @method static EnvVarEnum SITESTUDIO_ORG_KEY()
*/
class EnvVarEnum extends Enum {

Expand Down Expand Up @@ -106,6 +108,10 @@ class EnvVarEnum extends Enum {

public const DRUPAL_TEST_WEBDRIVER_PORT = 'DRUPAL_TEST_WEBDRIVER_PORT';

public const SITESTUDIO_API_KEY = 'SITESTUDIO_API_KEY';

public const SITESTUDIO_ORG_KEY = 'SITESTUDIO_ORG_KEY';

/**
* Descriptions for the environment variables.
*
Expand Down Expand Up @@ -147,6 +153,8 @@ public static function descriptions(): array {
self::DRUPAL_TEST_WEBDRIVER_CHROME_ARGS => 'The Chrome WebDriver arguments (Read-only)',
self::DRUPAL_TEST_WEBDRIVER_HOSTNAME => 'The WebDriver hostname (Read-only)',
self::DRUPAL_TEST_WEBDRIVER_PORT => 'The WebDriver port (Read-only)',
self::SITESTUDIO_API_KEY => 'The Site Studio API Key',
self::SITESTUDIO_ORG_KEY => 'The Site Studio ORG Key',
];
}

Expand Down

0 comments on commit 7e35cff

Please sign in to comment.