Skip to content

Commit

Permalink
lando/lando#1462: Refactor Drupal 10 MySQL 8 test with --option flag …
Browse files Browse the repository at this point in the history
…on ? From where should we get your app's codebase? (Use arrow keys)

  acquia
❯ current working directory
  github
  lagoon
  pantheon
  platformsh
  remote git repo or archive �[29D�[29C.
  • Loading branch information
reynoldsalec committed Feb 25, 2023
1 parent 3d7493a commit 4945193
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
5 changes: 0 additions & 5 deletions examples/drupal10-mysql8/.lando.yml

This file was deleted.

39 changes: 28 additions & 11 deletions examples/drupal10-mysql8/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Drupal 10 Example
Drupal 10 w/MySQL 8 Example
================

This example exists primarily to test the following documentation:
Expand All @@ -14,8 +14,12 @@ Run the following commands to get up and running with this example.
# Should poweroff
lando poweroff

# Should initialize the latest Drupal 10 codebase
rm -rf mysql8 && mkdir -p mysql8 && cd mysql8
lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-10.0.x-dev.tar.gz --remote-options="--strip-components 1" --recipe drupal10 --webroot . --name lando-drupal10-mysql8 --option database=mysql:8.0.22

# Should start up successfully
rm -rf mysql8 && mkdir -p mysql8 && cp .lando.yml mysql8/.lando.yml && cd mysql8
cd mysql8
echo -e "\nplugins:\n \"@lando/drupal/\": ./../../" >> .lando.yml
lando start
```
Expand All @@ -26,17 +30,34 @@ Verification commands
Run the following commands to validate things are rolling as they should.

```bash
# Should be running mysql 8.0.x
# Should return the drupal installation page by default
cd mysql8
lando ssh -s appserver -c "curl -L localhost" | grep "Drupal 10"

# Should use 8.1 as the default php version
cd mysql8
lando php -v | grep "PHP 8.1"

# Should be running apache 2.4 by default
cd mysql8
lando ssh -s appserver -c "apachectl -V | grep 2.4"
lando ssh -s appserver -c "curl -IL localhost" | grep Server | grep 2.4

# Should be running mysql 8.0.x by default
cd mysql8
lando mysql -V | grep 8.0

# Should use the default database connection info
# Should be running sqlite 3.34 by default
cd mysql8
lando mysql -udrupal10 -pdrupal10 drupal10 -e quit
lando php -r "print_r(SQLite3::version());" | grep versionString | grep 3.34

# Should not enable xdebug by default
cd mysql8
lando php -m | grep xdebug || echo $? | grep 1

# Should be able to retrieve Drupal 10 codebase
# Should use the default database connection info
cd mysql8
lando composer create-project drupal/recommended-project:10.0.x-dev@dev tmp && cp -r tmp/. . && rm -rf tmp
lando mysql -udrupal10 -pdrupal10 drupal10 -e quit

# Should use site-local drush if installed
cd mysql8
Expand All @@ -46,10 +67,6 @@ lando ssh -c "which drush" | grep "/app/vendor/bin/drush"
# Should be able to install drupal
cd mysql8
lando drush si --db-url=mysql://drupal10:drupal10@database/drupal10 -y

# Should show drupal homepage
cd mysql8
lando ssh -s appserver -c "curl -L localhost" | grep "Drush Site-Install"
```

Destroy tests
Expand Down

0 comments on commit 4945193

Please sign in to comment.