Skip to content

Commit

Permalink
Fix nightly tests - docker compose cmd (#595)
Browse files Browse the repository at this point in the history
* Fix docker compose cmd

* Fix version cmd
  • Loading branch information
alexz707 authored Aug 7, 2024
1 parent 52475d7 commit 2e2c051
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/pimcore-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ jobs:
set -ex
# Check (lint) the compose file
docker-compose -v
docker compose version
cd sample-project/
docker-compose -f docker-compose.yaml -f .github/ci/files/docker-compose.yaml config
docker compose -f docker-compose.yaml -f .github/ci/files/docker-compose.yaml config
- name: Test pimcore installation
env:
Expand All @@ -89,27 +89,27 @@ jobs:
cd sample-project/
# Start containers
docker-compose pull --quiet
docker-compose down -v --remove-orphans
docker-compose -f docker-compose.yaml -f .github/ci/files/docker-compose.yaml up -d
docker compose pull --quiet
docker compose down -v --remove-orphans
docker compose -f docker-compose.yaml -f .github/ci/files/docker-compose.yaml up -d
if [ ! -z "$PIMCORE_VERSION" ]; then
docker-compose exec -T -- php composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}"
docker compose exec -T -- php composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}"
fi
docker-compose exec -T -- php composer update --no-scripts
docker compose exec -T -- php composer update --no-scripts
# Install dockerize into the php container. We need it to block until
# database is ready to serve connections.
docker-compose exec -T -- php bash -c '\
docker compose exec -T -- php bash -c '\
curl -sfL https://github.com/powerman/dockerize/releases/download/v0.11.5/dockerize-`uname -s`-`uname -m` \
| install /dev/stdin /usr/local/bin/dockerize'
# Wait for the database to set up.
docker-compose exec -T -- php dockerize -wait tcp://db:3306 -timeout 5m
docker compose exec -T -- php dockerize -wait tcp://db:3306 -timeout 5m
# Run pimcore installation.
docker-compose exec -T \
docker compose exec -T \
-e PIMCORE_INSTALL_ADMIN_USERNAME=pimcore \
-e PIMCORE_INSTALL_ADMIN_PASSWORD=pimcore \
-e PIMCORE_INSTALL_MYSQL_USERNAME=pimcore \
Expand All @@ -121,7 +121,7 @@ jobs:
sudo chown -R www-data .
# Check if website is reachable
response=$(docker-compose exec -T -- php bash -c 'curl -s "nginx:80"')
response=$(docker compose exec -T -- php bash -c 'curl -s "nginx:80"')
if [[ ! $response =~ "Satisfaction" ]]; then
echo "Install failed, skipping build"
Expand All @@ -137,14 +137,14 @@ jobs:
set -ex
cd sample-project/
docker-compose exec -T -- php composer remove pimcore/platform-version --no-update
docker-compose exec -T -- php composer require pimcore/pimcore:"${UPGRADE_VERSION}" --with-all-dependencies
docker compose exec -T -- php composer remove pimcore/platform-version --no-update
docker compose exec -T -- php composer require pimcore/pimcore:"${UPGRADE_VERSION}" --with-all-dependencies
# Run pimcore migration.
docker-compose exec -T -- php ./bin/console doctrine:migrations:migrate
docker compose exec -T -- php ./bin/console doctrine:migrations:migrate
# Check if website is reachable, after upgrade
response=$(docker-compose exec -T -- php bash -c 'curl -s "nginx:80"')
response=$(docker compose exec -T -- php bash -c 'curl -s "nginx:80"')
if [[ ! $response =~ "Satisfaction" ]]; then
echo "Install failed, skipping build"
exit 1;
Expand All @@ -153,4 +153,4 @@ jobs:
- name: Compose down
run: |
cd sample-project/
docker-compose down -v --remove-orphans
docker compose down -v --remove-orphans

0 comments on commit 2e2c051

Please sign in to comment.