From 7af7c159fbfb890dc89bed1a2a01dbfca3009c60 Mon Sep 17 00:00:00 2001 From: "Liopold D. Novelli" Date: Tue, 5 Nov 2024 11:56:49 +0100 Subject: [PATCH] chore: LDP-2563: Use docker compose instead of docker-compose. --- .github/workflows/test-drupal-setup.yml | 8 +++---- README.md.dist | 30 ++++++++++++------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-drupal-setup.yml b/.github/workflows/test-drupal-setup.yml index 370d19ce1d..8691841dd6 100644 --- a/.github/workflows/test-drupal-setup.yml +++ b/.github/workflows/test-drupal-setup.yml @@ -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 @@ -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" diff --git a/README.md.dist b/README.md.dist index feafd3a1f2..50cdfca50b 100644 --- a/README.md.dist +++ b/README.md.dist @@ -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: @@ -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 @@ -28,12 +28,12 @@ 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: @@ -41,7 +41,7 @@ To setup the project, ensure you have all prerequesites fullfilled and follow ne * 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 @@ -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: @@ -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 @@ -93,17 +93,17 @@ 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`. @@ -111,13 +111,13 @@ The commands executed can be found in `phapp.yml`. ``` # 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