Refactor: consolidate workflow, fix SQLite permissions and paths

Contribution Date
Contribution Project
Contribution Details
Refactor: consolidate workflow, fix SQLite permissions and paths This commit consolidates the Docker build and test workflow into a single file (`docker-buildx.yml`), ensuring images are tested before being pushed. It also implements a robust solution for Drupal SQLite installation permissions, handling both absolute and relative paths returned by Drush. Key changes: - **Workflow Consolidation:** - `docker-buildx.yml`: Merged logic from `test-drupal.yml`. Uses `load: true` for testing and `push: true` on success. - `test-drupal.yml`: Deleted. - **Robust Drupal Installation (`tests/install-drupal.sh`):** - Accepts explicit version constraints (`^10`, `^11`) to prevent PHP/Drupal version mismatches. - Corrected SQLite connection string to remove `localhost` (`sqlite://sites/default/files/.ht.sqlite`). - **Dynamic Permission Fix:** Parses `drush status --format=json` to find the exact location of the SQLite database. - **Path Handling:** Added logic to detect relative paths (e.g. from Drupal 11) and prepend `${WEBROOT}/web/` to resolve them correctly. - Explicitly sets `chmod 777` on the directory and `chmod 666` on the database file. - **Improved Verification (`tests/verify-drupal.sh`):** - Updated debugging logic to dynamically find the SQLite database via Drush, handle relative paths, and log its specific permissions. - **Image Compatibility (`php8/apache-bookworm/Dockerfile`):** - Added `SQLITE_ENABLE_COLUMN_METADATA=1` to support Drupal requirements. Co-authored-by: hussainweb <1040271+hussainweb@users.noreply.github.com>
Contribution Author
hussainweb
Files count
0
Patches count
1