Skip to content

Commit

Permalink
Correct filesystem permissions in test setup (#162)
Browse files Browse the repository at this point in the history
* Reproduce the issue in test

* Fix README instuctions for test setup
  • Loading branch information
yariksheptykin authored Aug 3, 2023
1 parent 3b9b2fc commit f8138ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pimcore-skeleton.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ jobs:
cd sample-project/
# Set up docker-compose.yaml to use current user's uid:gid, just like README.md suggests.
sed -i "s|#user: '1000:1000'|user: '$(id -u):$(id -g)'|g" docker-compose.yaml
# Start containers
docker compose pull --quiet
docker compose up -d
Expand All @@ -87,5 +90,6 @@ jobs:
cd sample-project/
# Set up and execute codeception tests, just like README.md suggests.
docker compose run --user=root --rm test-php chown -R $(id -u):$(id -g) var/ public/var/
docker compose run --rm -T test-php vendor/bin/pimcore-install -n
docker compose run --rm -T test-php vendor/bin/codecept run -vv
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cd ./my-project
You can also use Docker to set up a new Pimcore Installation.
You don't need to have a PHP environment with composer installed.

### Prerequisits
### Prerequisites

* Your user must be allowed to run docker commands (directly or via sudo).
* You must have docker compose installed.
Expand All @@ -33,8 +33,7 @@ You don't need to have a PHP environment with composer installed.
`cd my-project/`

3. Part of the new project is a docker compose file
* Run `` echo `id -u`:`id -g` `` to retrieve your local user and group id
* Open the `docker-compose.yaml` file in an editor, uncomment all the `user: '1000:1000'` lines and update the ids if necessary
* Run `sed -i "s|#user: '1000:1000'|user: '$(id -u):$(id -g)'|g" docker-compose.yaml` to set the correct user id and group id.
* Start the needed services with `docker compose up -d`

4. Install pimcore and initialize the DB
Expand All @@ -44,6 +43,7 @@ You don't need to have a PHP environment with composer installed.
* If you select to install the SimpleBackendSearchBundle please make sure to add the `pimcore_search_backend_message` to your `.docker/supervisord.conf` file.

5. Run codeception tests:
* `docker compose run --user=root --rm test-php chown -R $(id -u):$(id -g) var/ public/var/`
* `docker compose run --rm test-php vendor/bin/pimcore-install -n`
* `docker compose run --rm test-php vendor/bin/codecept run -vv`

Expand Down

0 comments on commit f8138ae

Please sign in to comment.