Skip to content

Commit

Permalink
update to drupal 10
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood committed Nov 2, 2023
1 parent 0aa655d commit 301ee63
Show file tree
Hide file tree
Showing 12 changed files with 3,094 additions and 2,612 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Local project name - setting this here aligns container names with routes
COMPOSE_PROJECT_NAME=drupal9-opensearch
COMPOSE_PROJECT_NAME=drupal-opensearch
16 changes: 13 additions & 3 deletions .github/workflows/drupal-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,32 @@ jobs:
run: |
docker version
docker-compose version
docker compose version
lando version
node -v
yarn -v
- name: get user ids
run: |
ls -al .
whoami
id
id -u
id -g
getent group $(id -g)
groups
- name: Update codebase to follow CI configuration
run: |
sed -i -e "/###/d" docker-compose.yml
- name: Pull all images
run: |
docker-compose pull --ignore-pull-failures
docker compose pull --ignore-pull-failures
- name: Install test harness
run: |
yarn add leia-parser mocha chai command-line-test
- name: Generate test files
run: |
yarn leia "TESTING*.md" test -r 2 -s 'Start up tests' -t 'Verification commands' -c 'Destroy tests' --split-file
- name: Run docker-compose tests
- name: Run docker compose tests
run: |
yarn mocha --timeout 900000 test/*compose*.func.js
# - name: Run Lando tests
Expand All @@ -57,4 +67,4 @@ jobs:
# - name: Show Lando logs
# continue-on-error: true
# run: |
# docker-compose -p drupal9opensearch logs
# docker compose -p drupalopensearch logs
2 changes: 1 addition & 1 deletion .lagoon.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
docker-compose-yaml: docker-compose.yml

project: drupal9-opensearch
project: drupal-opensearch

tasks:
# pre-rollout:
Expand Down
2 changes: 1 addition & 1 deletion .lando.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: drupal9-opensearch
name: drupal-opensearch
recipe: lagoon
config:
flavor: drupal
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Base template for Drupal 9 projects hosted on Lagoon
# Base template for Drupal projects hosted on Lagoon

This template includes everything necessary to run on [Lagoon](https://www.github.com/uselagoon/lagoon) (in both the local development environments or on hosted Lagoon clusters.)

Expand All @@ -8,28 +8,28 @@ dependencies with [Composer](https://getcomposer.org/). It is based on the [orig
## Included Services

This example contains the following services:
* Drupal 9.2
* PHP 8.0
* Drupal 10.x
* PHP 8
* NGINX
* MariaDB 10.5
* MariaDB 10.11

To see similar projects with additional services, please visit https://github.com/lagoon-examples and to find out more about the services, please visit the documentation at https://docs.lagoon.sh/lagoon

## Requirements

* [docker](https://docs.docker.com/install/)
* [pygmy-go](https://www.github.com/fubarhouse/pygmy-go)
* [pygmy-go](https://www.github.com/pygmystack/pygmy)

**OR**

* [Lando](https://docs.lando.dev/basics/installation.html#system-requirements)

## Local environment setup - pygmy-go
## Local environment setup - pygmy

1. Checkout this project repo and confirm the path is in Docker's file sharing config - https://docs.docker.com/docker-for-mac/#file-sharing

```bash
git clone https://github.com/lagoon-examples/drupal9-opensearch.git drupal9-opensearch && cd $_
git clone https://github.com/lagoon-examples/drupal-opensearch.git drupal-opensearch && cd $_
```

2. Make sure you don't have anything running on port 80 on the host machine (like a web server) then run `pygmy-go up`
Expand All @@ -41,7 +41,7 @@ To see similar projects with additional services, please visit https://github.co
docker-compose exec cli composer install
```
4. Visit the new site @ `http://drupal9-opensearch.docker.amazee.io`
4. Visit the new site @ `http://drupal-opensearch.docker.amazee.io`
* If any steps fail, you're safe to rerun from any point.
Starting again from the beginning will just reconfirm the changes.
Expand All @@ -55,10 +55,10 @@ This repository is set up with a `.lando.yml` file, which allows you to use Land
2. Checkout the project repo and confirm the path is in Docker's file sharing config - https://docs.docker.com/docker-for-mac/#file-sharing
```bash
git clone https://github.com/lagoon-examples/drupal9-opensearch.git drupal9-opensearch && cd $_
git clone https://github.com/lagoon-examples/drupal-opensearch.git drupal-opensearch && cd $_
```
3. Make sure you have pygmy-go stopped. Run `pygmy-go stop` to be sure.
3. Make sure you have pygmy-go stopped. Run `pygmy stop` to be sure.
4. We already have a Lando file in this repository, so we just need to run the following command to get Lando up:
Expand All @@ -72,7 +72,7 @@ lando start
lando drush si -y
```
6. Visit the new site @ `http://drupal9-opensearch.lndo.site`
6. Visit the new site @ `http://drupal-opensearch.lndo.site`
7. For more information on how to configure your site, check out the [documentation](https://docs.lando.dev/config/lagoon.html).
Expand Down
22 changes: 11 additions & 11 deletions TESTING_dockercompose.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Docker Compose Drupal 9 Opensearch option - php8, nginx, mariadb, opensearch
Docker Compose Drupal Opensearch option - php8, nginx, mariadb, opensearch
============================================================================

This is a docker-compose version of the Lando example tests:
Expand All @@ -14,11 +14,11 @@ sed -i -e "/###/d" docker-compose.yml
docker network inspect amazeeio-network >/dev/null || docker network create amazeeio-network
docker-compose down

# Should start up our Lagoon Drupal 9 site successfully
# Should start up our Lagoon Drupal site successfully
docker-compose build && docker-compose up -d

# Ensure mariadb pod is ready to connect
docker run --rm --net drupal9-opensearch_default amazeeio/dockerize dockerize -wait tcp://mariadb:3306 -timeout 1m
docker run --rm --net drupal-opensearch_default amazeeio/dockerize dockerize -wait tcp://mariadb:3306 -timeout 1m
```

Verification commands
Expand All @@ -33,17 +33,17 @@ docker-compose exec -T cli bash -c "drush cr -y"
docker-compose exec -T cli bash -c "drush status" | grep "Drupal bootstrap" | grep "Successful"

# Should have all the services we expect
docker ps --filter label=com.docker.compose.project=drupal9-opensearch | grep Up | grep drupal9-opensearch_nginx_1
docker ps --filter label=com.docker.compose.project=drupal9-opensearch | grep Up | grep drupal9-opensearch_mariadb_1
docker ps --filter label=com.docker.compose.project=drupal9-opensearch | grep Up | grep drupal9-opensearch_php_1
docker ps --filter label=com.docker.compose.project=drupal9-opensearch | grep Up | grep drupal9-opensearch_cli_1
docker ps --filter label=com.docker.compose.project=drupal9-opensearch | grep Up | grep drupal9-opensearch_opensearch_1
docker ps --filter label=com.docker.compose.project=drupal-opensearch | grep Up | grep drupal-opensearch_nginx_1
docker ps --filter label=com.docker.compose.project=drupal-opensearch | grep Up | grep drupal-opensearch_mariadb_1
docker ps --filter label=com.docker.compose.project=drupal-opensearch | grep Up | grep drupal-opensearch_php_1
docker ps --filter label=com.docker.compose.project=drupal-opensearch | grep Up | grep drupal-opensearch_cli_1
docker ps --filter label=com.docker.compose.project=drupal-opensearch | grep Up | grep drupal-opensearch_opensearch_1

# Should ssh against the cli container by default
docker-compose exec -T cli bash -c "env | grep LAGOON=" | grep cli-drupal

# Should have the correct environment set
docker-compose exec -T cli bash -c "env" | grep LAGOON_ROUTE | grep drupal9-opensearch.docker.amazee.io
docker-compose exec -T cli bash -c "env" | grep LAGOON_ROUTE | grep drupal-opensearch.docker.amazee.io
docker-compose exec -T cli bash -c "env" | grep LAGOON_ENVIRONMENT_TYPE | grep development

# Should be running PHP 8
Expand All @@ -67,7 +67,7 @@ docker-compose exec -T cli bash -c "node --version"
# Should have yarn
docker-compose exec -T cli bash -c "yarn --version"

# Should have a running Drupal 9 site served by nginx on port 8080
# Should have a running Drupal site served by nginx on port 8080
docker-compose exec -T cli bash -c "curl -kL http://nginx:8080" | grep "Drush Site-Install"

# Should have Opensearch running
Expand Down Expand Up @@ -96,6 +96,6 @@ Destroy tests
Run the following commands to trash this app like nothing ever happened.

```bash
# Should be able to destroy our Drupal 9 site with success
# Should be able to destroy our Drupal site with success
docker-compose down --volumes --remove-orphans
```
26 changes: 13 additions & 13 deletions TESTING_lando.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Lando Drupal 9 Opensearch - php8, nginx, mariadb, opensearch
Lando Drupal Opensearch - php8, nginx, mariadb, opensearch
============================================================

This example exists primarily to test the following documentation:

* [Lagoon Recipe - Drupal 9](https://docs.lando.dev/config/lagoon.html)
* [Lagoon Recipe - Drupal](https://docs.lando.dev/config/lagoon.html)

Start up tests
--------------
Expand All @@ -16,7 +16,7 @@ lando --clear
lando destroy -y
lando poweroff

# Should start up our Lagoon Drupal 9 site successfully
# Should start up our Lagoon Drupal site successfully
lando start
```

Expand All @@ -32,19 +32,19 @@ lando drush cr -y
lando drush status | grep "Drupal bootstrap" | grep "Successful"

# Should have all the services we expect
docker ps --filter label=com.docker.compose.project=drupal9opensearch | grep Up | grep drupal9opensearch_nginx_1
docker ps --filter label=com.docker.compose.project=drupal9opensearch | grep Up | grep drupal9opensearch_mariadb_1
docker ps --filter label=com.docker.compose.project=drupal9opensearch | grep Up | grep drupal9opensearch_mailhog_1
docker ps --filter label=com.docker.compose.project=drupal9opensearch | grep Up | grep drupal9opensearch_php_1
docker ps --filter label=com.docker.compose.project=drupal9opensearch | grep Up | grep drupal9opensearch_cli_1
docker ps --filter label=com.docker.compose.project=drupal9opensearch | grep Up | grep drupal9opensearch_lagooncli_1
docker ps --filter label=com.docker.compose.project=drupal9opensearch | grep Up | grep drupal9opensearch_opensearch_1
docker ps --filter label=com.docker.compose.project=drupalopensearch | grep Up | grep drupalopensearch_nginx_1
docker ps --filter label=com.docker.compose.project=drupalopensearch | grep Up | grep drupalopensearch_mariadb_1
docker ps --filter label=com.docker.compose.project=drupalopensearch | grep Up | grep drupalopensearch_mailhog_1
docker ps --filter label=com.docker.compose.project=drupalopensearch | grep Up | grep drupalopensearch_php_1
docker ps --filter label=com.docker.compose.project=drupalopensearch | grep Up | grep drupalopensearch_cli_1
docker ps --filter label=com.docker.compose.project=drupalopensearch | grep Up | grep drupalopensearch_lagooncli_1
docker ps --filter label=com.docker.compose.project=drupalopensearch | grep Up | grep drupalopensearch_opensearch_1

# Should ssh against the cli container by default
lando ssh -c "env | grep LAGOON=" | grep cli-drupal

# Should have the correct environment set
lando ssh -c "env" | grep LAGOON_ROUTE | grep drupal9-opensearch.lndo.site
lando ssh -c "env" | grep LAGOON_ROUTE | grep drupal-opensearch.lndo.site
lando ssh -c "env" | grep LAGOON_ENVIRONMENT_TYPE | grep development

# Should be running PHP 8
Expand All @@ -71,7 +71,7 @@ lando yarn --version
# Should have lagoon cli
lando lagoon --version | grep lagoon

# Should have a running Drupal 9 site served by nginx on port 8080
# Should have a running Drupal site served by nginx on port 8080
lando ssh -s cli -c "curl -kL http://nginx:8080" | grep "Welcome to Drush Site-Install"

# Should have Opensearch running
Expand Down Expand Up @@ -99,7 +99,7 @@ Destroy tests
Run the following commands to trash this app like nothing ever happened.

```bash
# Should be able to destroy our Drupal 9 site with success
# Should be able to destroy our Drupal site with success
lando destroy -y
lando poweroff
```
25 changes: 13 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lagoon-examples/drupal9-opensearch",
"description": "Project template for Drupal 9 projects with MariaDB, hosted on Lagoon",
"name": "lagoon-examples/drupal-opensearch",
"description": "Project template for Drupal projects with MariaDB, hosted on Lagoon",
"type": "project",
"license": "GPL-2.0-or-later",
"authors": [
Expand All @@ -20,18 +20,15 @@
"amazeeio/drupal_integrations": "0.3.7",
"composer/installers": "2.2.0",
"cweagans/composer-patches": "1.7.3",
"drupal/core-composer-scaffold": "9.5.11",
"drupal/core-project-message": "9.5.11",
"drupal/core-recommended": "9.5.11",
"drupal/lagoon_logs": "2.1.1",
"drupal/core-composer-scaffold": "10.1.6",
"drupal/core-project-message": "10.1.6",
"drupal/core-recommended": "10.1.6",
"drupal/lagoon_logs": "3.0.0",
"drupal/search_api": "1.30.0",
"drupal/search_api_opensearch": "1.0.0-beta1",
"drush/drush": "11.6.0",
"drupal/search_api_opensearch": "2.0.0-beta3",
"drush/drush": "12.4.2",
"zaporylie/composer-drupal-optimizations": "1.2.0"
},
"require-dev": {
"drupal/core-dev-pinned": "9.5.11"
},
"conflict": {
"drupal/drupal": "*"
},
Expand All @@ -46,7 +43,8 @@
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"zaporylie/composer-drupal-optimizations": true,
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
}
},
"extra": {
Expand All @@ -71,5 +69,8 @@
"web-root": "web/"
}
}
},
"require-dev": {
"drupal/core-dev-pinned": "10.1.6"
}
}
Loading

0 comments on commit 301ee63

Please sign in to comment.