Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust gitpod setup steps #1717

Merged
merged 4 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 18 additions & 28 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,30 @@
github:
prebuilds:
master: true
branches: false
pullRequests: true
pullRequestsFromForks: false
addCheck: false
addComment: false
addBadge: false
ports:
- port: 3306
onOpen: ignore
visibility: private
- port: 33060
onOpen: ignore
visibility: private
- port: 8001
- port: 8001-8999
onOpen: ignore
visibility: public
image: pookmish/drupal8ci:gitpod
tasks:
- before: >
eval $(command gp env -e) &&
mkdir -p ~/.ssh &&
[[ ! -z $SSH_PUBLIC_KEY ]] &&
echo $SSH_PUBLIC_KEY | base64 -d > ~/.ssh/id_rsa.pub &&
chmod 644 ~/.ssh/id_rsa.pub &&
[[ ! -z $SSH_PRIVATE_KEY ]] &&
echo $SSH_PRIVATE_KEY | base64 -d > ~/.ssh/id_rsa &&
chmod 600 ~/.ssh/id_rsa &&
[[ ! -z $GITCONFIG ]] &&
echo $GITCONFIG | base64 -d > ~/.gitconfig &&
chmod 644 ~/.gitconfig
- name: SSH Keys
before: |
mkdir -p ~/.ssh
if [[ ! -z $SSH_PRIVATE_KEY ]]; then
echo $SSH_PRIVATE_KEY | base64 -d > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa &&
git remote set-url origin [email protected]:SU-HSDO/suhumsci.git
fi
if [[ ! -z $GITCONFIG ]]; then
echo $GITCONFIG | base64 -d > ~/.gitconfig && chmod 644 ~/.gitconfig
fi
init: >
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 @@ -43,15 +33,15 @@ tasks:
blt settings &&
mysql -u root -e 'CREATE DATABASE IF NOT EXISTS drupal_default; CREATE DATABASE IF NOT EXISTS drupal' &&
blt sws:keys &&
blt source:build:simplesamlphp-config &&
mysql -e 'SET GLOBAL max_allowed_packet=67108864;' &&
blt drupal:sync --site=hs_colorful -n &&
drush sql-sync @hs_colorful.local @self -y

if [[ ! -z $SSH_PRIVATE_KEY ]]; then
blt drupal:sync --site=hs_colorful -n &&
drush sql-sync @hs_colorful.local @self -y
else
blt drupal:install --no-interaction
fi
command: >
git config core.fileMode false &&
blt blt:telemetry:disable --no-interaction &&
git remote set-url origin [email protected]:SU-HSDO/suhumsci.git &&
apache2ctl restart &&
gp ports await 8001 &&
drush uli &&
Expand Down
10 changes: 10 additions & 0 deletions .gitpod/gitpod.settings.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<?php

error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);

$config['samlauth.authentication']['sp_x509_certificate'] = 'file:' . DRUPAL_ROOT . '/../keys/saml/cert/saml.crt';
$config['samlauth.authentication']['sp_private_key'] = 'file:' . DRUPAL_ROOT . '/../keys/saml/cert/saml.pem';
$config['samlauth.authentication']['idp_certs'] = [
'file:' . DRUPAL_ROOT . '/../keys/saml/cert/signing.crt',
];
$config['stanford_samlauth.settings']['role_mapping']['workgroup_api'] = [
'cert' => DRUPAL_ROOT . '/../keys/saml/workgroup_api.cert',
'key' => DRUPAL_ROOT . '/../keys/saml/workgroup_api.key',
];
19 changes: 19 additions & 0 deletions .gitpod/sites.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

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

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

$port = 8002;
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;
$port++;
}
Loading