4040 # We execute composer within docker container to suttisfy platform requirements.
4141 # The value of ´"url":` must match checkout path in the first step.
4242 #
43+ # Using --no-install so dependencies are installed later inside
44+ # docker-compose where infrastructure services (db, etc.) are available.
45+ #
4346 # See: https://getcomposer.org/doc/03-cli.md#create-project
4447 # See: https://getcomposer.org/doc/05-repositories.md#path
4548 docker run \
5053 composer create-project \
5154 pimcore/skeleton:@dev \
5255 --repository='{"type": "path", "url": "./skeleton"}' \
56+ --no-install \
5357 sample-project
5458
5559 - name : Smoke-test compose file
@@ -80,15 +84,27 @@ jobs:
8084 docker compose pull --quiet
8185 docker compose up -d
8286
87+ # Install dependencies inside docker-compose where services are available.
88+ docker compose exec -T -- php composer install
89+
90+ # Install dockerize to wait for services (needs root for /usr/local/bin).
91+ docker compose exec --user=root -T -- php bash -c '\
92+ curl -sfL https://github.com/powerman/dockerize/releases/download/v0.11.5/dockerize-`uname -s`-`uname -m` \
93+ | install /dev/stdin /usr/local/bin/dockerize'
94+
95+ # Wait for infrastructure services to be ready.
96+ docker compose exec -T -- php dockerize -wait tcp://db:3306 -timeout 5m
97+ docker compose exec -T -- php dockerize -wait tcp://opensearch:9200 -timeout 5m
98+ docker compose exec -T -- php dockerize -wait tcp://rabbitmq:5672 -timeout 5m
99+
83100 # Run pimcore installation.
101+ # Product registration secrets come from GitHub secrets.
102+ # Everything else is read from .env.
84103 docker compose exec -T \
85- -e PIMCORE_INSTALL_ADMIN_USERNAME=pimcore \
86- -e PIMCORE_INSTALL_ADMIN_PASSWORD=pimcore \
87- -e PIMCORE_INSTALL_ENCRYPTION_SECRET=${PIMCORE_ENCRYPTION_SECRET} \
88- -e PIMCORE_INSTALL_INSTANCE_IDENTIFIER=${PIMCORE_INSTANCE_IDENTIFIER} \
89- -e PIMCORE_INSTALL_PRODUCT_KEY=${PIMCORE_PRODUCT_KEY} \
90- -- \
91- php vendor/bin/pimcore-install -n
104+ -e PIMCORE_ENCRYPTION_SECRET="${PIMCORE_ENCRYPTION_SECRET}" \
105+ -e PIMCORE_INSTANCE_IDENTIFIER="${PIMCORE_INSTANCE_IDENTIFIER}" \
106+ -e PIMCORE_PRODUCT_KEY="${PIMCORE_PRODUCT_KEY}" \
107+ -- php vendor/bin/pimcore-install --install-profile=App\\Installer\\SkeletonProfile --no-interaction
92108
93109 - name : Run codeception tests
94110 env :
@@ -104,10 +120,15 @@ jobs:
104120 # Set up and execute codeception tests, just like README.md suggests.
105121 docker compose run --user=root --rm test-php chown -R $(id -u):$(id -g) var/ public/var/
106122 docker compose run --rm -T \
107- -e PIMCORE_INSTALL_ADMIN_USERNAME=pimcore \
108- -e PIMCORE_INSTALL_ADMIN_PASSWORD=pimcore \
109- -e PIMCORE_INSTALL_ENCRYPTION_SECRET=${PIMCORE_ENCRYPTION_SECRET} \
110- -e PIMCORE_INSTALL_INSTANCE_IDENTIFIER=${PIMCORE_INSTANCE_IDENTIFIER} \
111- -e PIMCORE_INSTALL_PRODUCT_KEY=${PIMCORE_PRODUCT_KEY} \
112- test-php vendor/bin/pimcore-install -n
113- docker compose run --rm -T test-php vendor/bin/codecept run -vv
123+ -e DATABASE_URL=mysql://pimcore:pimcore@test-db:3306/pimcore \
124+ -e PIMCORE_ENCRYPTION_SECRET="${PIMCORE_ENCRYPTION_SECRET}" \
125+ -e PIMCORE_INSTANCE_IDENTIFIER="${PIMCORE_INSTANCE_IDENTIFIER}" \
126+ -e PIMCORE_PRODUCT_KEY="${PIMCORE_PRODUCT_KEY}" \
127+ test-php vendor/bin/pimcore-install --install-profile=App\\Installer\\SkeletonProfile --no-interaction --skip-validation=opensearch --skip-validation=messenger-amqp --skip-validation=mercure
128+ # Product registration secrets must be passed as a matched set —
129+ # the product key is validated against the encryption secret.
130+ docker compose run --rm -T \
131+ -e PIMCORE_ENCRYPTION_SECRET="${PIMCORE_ENCRYPTION_SECRET}" \
132+ -e PIMCORE_INSTANCE_IDENTIFIER="${PIMCORE_INSTANCE_IDENTIFIER}" \
133+ -e PIMCORE_PRODUCT_KEY="${PIMCORE_PRODUCT_KEY}" \
134+ test-php vendor/bin/codecept run -vv
0 commit comments