Skip to content

Commit b091c89

Browse files
committed
ci: [SITE-5766] Re-enable cleanup, add fixture bootstrap script (Phase 5)
1 parent f1a4631 commit b091c89

2 files changed

Lines changed: 69 additions & 4 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Bootstrap the D7 Solr 9 CI fixture site from scratch.
5+
# Installs Drupal and seeds 20 article nodes with real content.
6+
# Idempotent: drops existing DB and reinstalls.
7+
#
8+
# Usage: bash solr9-bootstrap-fixture.sh <site-name> <env>
9+
# Example: bash solr9-bootstrap-fixture.sh search-api-pantheon-d7 dev
10+
11+
SITE="${1:?Usage: $0 <site-name> <env>}"
12+
ENV="${2:-dev}"
13+
SITE_ENV="$SITE.$ENV"
14+
15+
echo "=== Bootstrapping fixture site: $SITE_ENV ==="
16+
17+
echo "--- Installing Drupal ---"
18+
terminus drush "$SITE_ENV" -- site-install standard \
19+
--site-name="D7 Solr 9 CI" \
20+
--account-name=admin \
21+
--account-pass=admin \
22+
-y
23+
24+
echo "--- Creating article nodes ---"
25+
terminus drush "$SITE_ENV" -- ev '
26+
$articles = array(
27+
array("Getting Started with Apache Solr on Pantheon", "Apache Solr is a powerful open-source search platform built on Apache Lucene. Pantheon provides managed Solr instances for every environment, enabling fast full-text search across your Drupal content. This guide covers initial setup, schema posting, and indexing your first batch of content."),
28+
array("Understanding Drupal Content Types and Fields", "Drupal organizes content into types such as articles, pages, and custom bundles. Each content type can have fields for text, images, taxonomy references, and more. Properly structured content types improve both editorial workflow and search relevance."),
29+
array("WordPress to Drupal Migration Best Practices", "Migrating from WordPress to Drupal requires careful planning around content mapping, URL redirects, and user account migration. The Migrate module provides a framework for pulling content from external sources including WordPress databases and XML exports."),
30+
array("Performance Optimization for High Traffic Websites", "High traffic websites require careful attention to caching, database query optimization, and CDN configuration. Pantheon Global CDN provides edge caching with surrogate key purging, while Varnish handles full-page caching at the platform level."),
31+
array("Search Engine Optimization Techniques for Drupal", "Effective SEO in Drupal involves clean URL structures, proper meta tag configuration, XML sitemaps, and structured data markup. The Pathauto module generates search-friendly URLs automatically based on content patterns."),
32+
array("Configuring Multidev Environments on Pantheon", "Multidev environments allow teams to work on parallel feature branches without interfering with each other. Each multidev gets its own database, files, and server environment cloned from an existing environment."),
33+
array("Database Backup and Recovery Strategies", "Regular database backups are essential for disaster recovery. Pantheon provides automated daily backups and on-demand backup creation. Recovery involves downloading the backup archive and importing it into the target environment."),
34+
array("Custom Module Development in Drupal 7", "Building custom modules in Drupal 7 follows the hook system architecture. Modules implement hooks like hook_menu, hook_form_alter, and hook_node_view to extend core functionality. The module .info file declares dependencies and metadata."),
35+
array("Solr Schema Configuration and Field Mapping", "The Solr schema defines how content fields are indexed and searched. Field types control tokenization, stemming, and analysis chains. Proper field mapping ensures that search queries return relevant results with appropriate boosting."),
36+
array("Terminus Command Line Interface Reference", "Terminus is the command line interface for Pantheon. It provides commands for site management, environment operations, and workflow automation. Common commands include site creation, database operations, and deployment workflows."),
37+
array("Managing SSL Certificates for Custom Domains", "Custom domains on Pantheon require DNS configuration and SSL certificate provisioning. The platform provides free automated HTTPS through Let us Encrypt. Proper DNS setup includes A records, CNAME records, and CAA records for certificate authority authorization."),
38+
array("Cron Job Scheduling and Automation in Drupal", "Drupal cron runs periodic maintenance tasks including content indexing, cache clearing, and queue processing. On Pantheon, cron runs automatically every hour. Custom cron intervals can be configured using the Elysia Cron module or hook_cron implementations."),
39+
array("User Authentication and Role Management", "Drupal provides a robust permission system with roles and granular access controls. Users can be assigned multiple roles, each granting specific permissions. SAML and OAuth integrations enable single sign-on with external identity providers."),
40+
array("Responsive Theme Development with Drupal 7", "Building responsive themes in Drupal 7 requires media queries, fluid grids, and flexible images. The theme layer uses template files, preprocess functions, and the render API. Mobile-first design ensures optimal experience across devices."),
41+
array("Version Control Workflows for Drupal Teams", "Git-based workflows on Pantheon support feature branching, code review, and automated deployments. Teams typically use a trunk-based development model with short-lived feature branches. Pull requests enable peer review before merging to the main branch."),
42+
array("Debugging PHP Errors and Watchdog Logs", "Drupal watchdog logs capture errors, warnings, and informational messages from modules and core. The dblog module stores entries in the database accessible at admin reports dblog. Common PHP errors include undefined function calls, memory limits, and deprecated function usage."),
43+
array("Taxonomy and Vocabulary Configuration Guide", "Taxonomy provides hierarchical classification for Drupal content. Vocabularies group related terms, and term references connect content to classification schemes. Faceted search leverages taxonomy to filter results by category, tag, or other classification dimensions."),
44+
array("Integrating Third Party APIs with Drupal", "Drupal modules can consume external APIs using drupal_http_request or the Guzzle HTTP client. API keys and credentials should be stored securely using the Key module or environment variables. Rate limiting and caching prevent excessive API calls."),
45+
array("Content Moderation and Editorial Workflows", "Editorial workflows in Drupal manage content through draft, review, and published states. The Workbench Moderation module provides configurable states and transitions. Role-based permissions control who can create, edit, and publish content at each stage."),
46+
array("Redis Object Caching for Improved Performance", "Redis provides in-memory object caching that reduces database queries and improves page load times. Pantheon offers Redis as a platform service with automatic failover. The Redis module integrates Drupal cache bins with the Redis backend for persistent object storage."),
47+
);
48+
foreach ($articles as $a) {
49+
$node = new stdClass();
50+
$node->type = "article";
51+
$node->title = $a[0];
52+
$node->language = LANGUAGE_NONE;
53+
$node->body[LANGUAGE_NONE][0] = array("value" => $a[1], "format" => "filtered_html");
54+
$node->status = 1;
55+
$node->promote = 1;
56+
node_save($node);
57+
echo "Created: " . $node->title . "\n";
58+
}
59+
echo "BOOTSTRAP_COMPLETE";
60+
'
61+
62+
echo "--- Verifying ---"
63+
NODE_COUNT=$(terminus drush "$SITE_ENV" -- ev "echo db_query('SELECT COUNT(*) FROM {node}')->fetchField();" 2>&1 | head -1)
64+
echo "Node count: $NODE_COUNT"
65+
66+
echo "=== Fixture site $SITE_ENV bootstrapped with $NODE_COUNT articles ==="

.github/workflows/solr9-cujs.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ jobs:
8989
- name: CUJ 8 - Validate Search Results
9090
run: bash .github/scripts/solr9-cuj8-validate-search.sh
9191

92-
# TODO: Re-enable after testing is complete
93-
# - name: Delete multidev on success
94-
# if: success()
95-
# run: terminus multidev:delete "$TERMINUS_SITE.$MULTIDEV" --delete-branch --yes || true
92+
- name: Delete multidev on success
93+
if: success()
94+
run: terminus multidev:delete "$TERMINUS_SITE.$MULTIDEV" --delete-branch --yes || true
9695

9796
- name: Show multidev URL on failure
9897
if: failure()

0 commit comments

Comments
 (0)