Skip to content

Commit

Permalink
chore: LDP-2563: Use docker compose instead of docker-compose.
Browse files Browse the repository at this point in the history
  • Loading branch information
Liopold D. Novelli committed Nov 5, 2024
1 parent 2e18024 commit 7af7c15
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test-drupal-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
key: ${{ runner.os }}-composer-v1-${{ hashFiles('./composer.json') }}
restore-keys: |
${{ runner.os }}-composer-v1
- name: Install docker-compose.
- name: Install docker compose.
run: |
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker-compose version
docker compose version
- name: Install composer dependencies.
run: |
composer config platform-check false
Expand All @@ -48,11 +48,11 @@ jobs:
run: |
export COMPOSE_DEFAULT_USER=$(id -u $USER)
docker-compose up -d
echo "Waiting for mysql to come up..." && docker exec -it $(docker-compose ps -q cli) /bin/bash -c "while ! echo exit | nc mariadb 3306; do sleep 1; done" >/dev/null
echo "Waiting for mysql to come up..." && docker exec -it $(docker compose ps -q cli) /bin/bash -c "while ! echo exit | nc mariadb 3306; do sleep 1; done" >/dev/null
- name: Install the project
shell: 'script -q -e -c "bash {0}"'
run: |
docker-compose exec cli phapp install --no-build
docker compose exec cli phapp install --no-build
- name: Check connection and response of the site
run: |
curl -v http://example.drupal-project.localdev.space | grep "Drupal 10"
30 changes: 15 additions & 15 deletions README.md.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This project is maintained using composer. Please refer to the documentation pro

## Prerequesites

* Install docker and [docker-compose](https://docs.docker.com/compose/install/) - use version 1.22.0 or later.
* Install docker and [docker compose](https://docs.docker.com/compose/install/) - use version 1.22.0 or later.

* Install phapp (see tools) - or use the project-local version if preferred:

Expand All @@ -18,7 +18,7 @@ This project is maintained using composer. Please refer to the documentation pro
# Check ID:
id -u $USER
# If not 1000, run:
echo "# Allow docker-compose setup to switch to the correct user." >> ~/.bashrc
echo "# Allow docker compose setup to switch to the correct user." >> ~/.bashrc
echo "export COMPOSE_DEFAULT_USER=$(id -u $USER)" >> ~/.bashrc
bash

Expand All @@ -28,20 +28,20 @@ To setup the project, ensure you have all prerequesites fullfilled and follow ne

* Optional: Drop container and data from previous runs:

docker-compose down -v
docker compose down -v

* Initialize setup and run docker compose

phapp setup localdev
docker-compose up -d --build
docker compose up -d --build

* Build the app:

phapp build

* Run `phapp init` to quickly initialize the application.

docker-compose exec cli phapp init --no-build
docker compose exec cli phapp init --no-build

## Localdev project URLs

Expand All @@ -54,8 +54,8 @@ To setup the project, ensure you have all prerequesites fullfilled and follow ne
For now most phapp and drush must be from inside the docker container.
Do so via

docker-compose exec cli phapp init --no-build
docker-compose exec cli drush cr
docker compose exec cli phapp init --no-build
docker compose exec cli drush cr

However, the exception is `phapp build`. Run it on the host so that your SSH key(s)
are picked up and you can access private repositories:
Expand All @@ -64,7 +64,7 @@ are picked up and you can access private repositories:

During development it's convenient to permanently switch to the docker cli container:

docker-compose exec cli bash
docker compose exec cli bash
drush cr

## Command line tools
Expand Down Expand Up @@ -93,31 +93,31 @@ instructions on how to install phapp globally.

```
# Get in the docker web container (where you can use the phapp commands)
docker-compose exec cli bash
docker compose exec cli bash

# Quick-install the application for development:
docker-compose exec cli phapp init --no-build
docker compose exec cli phapp init --no-build

# Update the build and run updates after switching branches:
phapp build
docker-compose exec cli phapp update --no-build
docker compose exec cli phapp update --no-build

# Install the app from scratch:
docker-compose exec cli phapp install
docker compose exec cli phapp install
```
The commands executed can be found in `phapp.yml`.

- During development, some useful commands are:

```
# Config export (export your config changes):
docker-compose exec cli drush cex -y
docker compose exec cli drush cex -y

# Config import (manual import of config files):
docker-compose exec cli drush cim -y
docker compose exec cli drush cim -y

# Cache clear/rebuild:
docker-compose exec cli drush cr
docker compose exec cli drush cr
```

## Running tests
Expand Down

0 comments on commit 7af7c15

Please sign in to comment.