Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: LDP-2635: Use docker compose instead of docker-compose. #74

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions .github/workflows/test-drupal-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ jobs:
key: ${{ runner.os }}-composer-v1-${{ hashFiles('./composer.json') }}
restore-keys: |
${{ runner.os }}-composer-v1
- 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
- name: Install composer dependencies.
run: |
composer config platform-check false
Expand All @@ -47,12 +40,12 @@ jobs:
shell: 'script -q -e -c "bash {0}"'
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
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
- 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
Loading