Skip to content

Commit

Permalink
DIGITAL-456: Sitemap fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
casey-rapnicki-bixal committed Mar 5, 2025
1 parent 06b593d commit fb520e0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,23 @@ public function static(
$io->info('Doing an incremental update');
}

$this->_exec('./drush.sh state:set xmlsitemap_base_url http://127.0.0.1:8080');
$cf_application_data = json_decode(getenv('VCAP_APPLICATION') ?? '{}', TRUE);

if(!empty($cf_application_data['application_name'])) {
$this->_exec('./drush.sh state:set xmlsitemap_base_url https://'.str_replace("drupal", "static", $cf_application_data['application_name']).".app.cloud.gov");
} else {
$this->_exec('./drush.sh state:set xmlsitemap_base_url http://127.0.0.1:8080');
}

$this->_exec('./drush.sh xmlsitemap:regenerate');
$this->_exec('./drush.sh tome:static --path-count=1 --retry-count=3 -y');
$this->_exec('./drush.sh state:set xmlsitemap_base_url http://digitalgov.lndo.site');

if(!empty($cf_application_data['application_name'])) {
$this->_exec('./drush.sh state:set xmlsitemap_base_url https://'.$cf_application_data['application_name'].".app.cloud.gov");
} else {
$this->_exec('./drush.sh state:set xmlsitemap_base_url http://digitalgov.lndo.site');
}

$this->_exec('./drush.sh xmlsitemap:regenerate');
if ($start_server) {
$this->_exec('npm install && npx http-server html');
Expand Down

0 comments on commit fb520e0

Please sign in to comment.