Skip to content

Commit

Permalink
expose more ports for more site support
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Jan 14, 2025
1 parent 7efba0b commit ed30e6c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ports:
- port: 33060
onOpen: ignore
visibility: private
- port: 8001
- port: 8001-8999
onOpen: ignore
visibility: public
image: pookmish/drupal8ci:gitpod
Expand All @@ -24,6 +24,7 @@ tasks:
export PREVIEW_FULL_URL=`gp url 8001` &&
export PREVIEW_URL=${PREVIEW_FULL_URL#"https://"} &&
cp .gitpod/blt.yml blt/local.blt.yml &&
cp .gitpod/sites.php docroot/sites/local.sites.php &&
composer install --no-interaction &&
rm -rf docroot/*/custom/* &&
composer install --prefer-source --no-interaction &&
Expand All @@ -41,7 +42,6 @@ tasks:
fi
command: >
git config core.fileMode false &&
blt blt:telemetry:disable --no-interaction &&
apache2ctl restart &&
gp ports await 8001 &&
drush uli &&
Expand Down
22 changes: 22 additions & 0 deletions .gitpod/sites.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

$settings = glob(__DIR__ . '/*/settings.php');

$workspace_url = getenv('GITPOD_WORKSPACE_URL');
$workspace_domain = preg_replace('/^.*?\/\//', '', $workspace_url);

// For each directory with a settings.php file, create possible combinations
// of the urls for that directory. A single underscore `_` in the direcotry name
// represents a dash `-` in the url. A double underscore represents a period `.`
// in the url. Using this standard we can easily keep track of what urls is for
// each site directory.
foreach ($settings as $settings_file) {
$site_dir = str_replace(__DIR__ . '/', '', $settings_file);
$site_dir = str_replace('/settings.php', '', $site_dir);

if ($site_dir == 'default') {
$site_dir = 'swshumsci';
}

$sites["$port-$workspace_domain"] = $site_dir;
}

0 comments on commit ed30e6c

Please sign in to comment.