Skip to content

Commit

Permalink
ci: use docker compose instead of docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
twojtylak committed Sep 24, 2024
1 parent e291605 commit e0bfd66
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions etc/scripts/runTests.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/usr/bin/env bash

#
# TYPO3 core test runner based on docker and docker-compose.
# TYPO3 core test runner based on docker and docker compose.
#

# Function to write a .env file in etc/testing-docker/local
# This is read by docker-compose and vars defined here are
# used in etc/testing-docker/local/docker-compose.yml
# This is read by docker compose and vars defined here are
# used in etc/testing-docker/local/docker compose.yml
setUpDockerComposeDotEnv() {
# Delete possibly existing local .env file if exists
[ -e .env ] && rm .env
# Set up a new .env file for docker-compose
# Set up a new .env file for docker compose
echo "COMPOSE_PROJECT_NAME=local" >> .env
# To prevent access rights of files created by the testing, the docker image later
# runs with the same user that is currently executing the script. docker-compose can't
# runs with the same user that is currently executing the script. docker compose can't
# use $UID directly itself since it is a shell variable and not an env variable, so
# we have to set it explicitly here.
echo "HOST_UID=`id -u`" >> .env
Expand Down Expand Up @@ -101,9 +101,9 @@ Options:
EOF

# Test if docker-compose exists, else exit out with error
if ! type "docker-compose" > /dev/null; then
echo "This script relies on docker and docker-compose. Please install" >&2
# Test if docker compose exists, else exit out with error
if ! type "docker compose" > /dev/null; then
echo "This script relies on docker and docker compose. Please install" >&2
exit 1
fi

Expand All @@ -112,7 +112,7 @@ fi
THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$THIS_SCRIPT_DIR" || exit 1

# Go to directory that contains the local docker-compose.yml file
# Go to directory that contains the local docker compose.yml file
cd ../testing-docker || exit 1

# Option defaults
Expand Down Expand Up @@ -202,9 +202,9 @@ fi
case ${TEST_SUITE} in
acceptance)
setUpDockerComposeDotEnv
docker-compose run acceptance_backend_mariadb10
docker compose run acceptance_backend_mariadb10
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;

clean)
Expand All @@ -216,21 +216,21 @@ case ${TEST_SUITE} in
if [ -f "../../composer.json.testing" ]; then
cp ../../composer.json ../../composer.json.orig
fi
docker-compose run composer_update
docker compose run composer_update
cp ../../composer.json ../../composer.json.testing
mv ../../composer.json.orig ../../composer.json
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
functional)
setUpDockerComposeDotEnv
case ${DBMS} in
mariadb)
docker-compose run functional_mariadb10
docker compose run functional_mariadb10
SUITE_EXIT_CODE=$?
;;
postgres)
docker-compose run functional_postgres10
docker compose run functional_postgres10
SUITE_EXIT_CODE=$?
;;
sqlite)
Expand All @@ -239,7 +239,7 @@ case ${TEST_SUITE} in
# root if docker creates it. Thank you, docker. We create the path beforehand
# to avoid permission issues.
mkdir -p ${ROOT_DIR}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/
docker-compose run functional_sqlite
docker compose run functional_sqlite
SUITE_EXIT_CODE=$?
;;
*)
Expand All @@ -248,19 +248,19 @@ case ${TEST_SUITE} in
echo "${HELP}" >&2
exit 1
esac
docker-compose down
docker compose down
;;
lint)
setUpDockerComposeDotEnv
docker-compose run lint
docker compose run lint
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
unit)
setUpDockerComposeDotEnv
docker-compose run unit
docker compose run unit
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
update)
# pull typo3/core-testing-*:latest versions of those ones that exist locally
Expand Down

0 comments on commit e0bfd66

Please sign in to comment.