|
| 1 | +# General Guidelines for the Support Team |
| 2 | + |
| 3 | +## Requirements |
| 4 | +* Docker Engine version 23.0 or later |
| 5 | +* Docker Compose version 2.0 or later |
| 6 | +* An editor or IDE |
| 7 | + |
| 8 | +Note: We recommend using a Linux Ubuntu-based OS for the best experience. |
| 9 | + |
| 10 | +## Components |
| 11 | +1. PHP 8.5 fpm |
| 12 | +2. Composer 2 |
| 13 | +3. Phive 0.16 |
| 14 | +4. Phing 3.1 |
| 15 | +5. Xalan 1.12 |
| 16 | + |
| 17 | +## Setting up Docker Engine & Docker Compose |
| 18 | +To install Docker Engine and Docker Compose, please follow the official [Docker Engine Installation Guide](https://docs.docker.com/engine/install/). |
| 19 | + |
| 20 | +**For Linux Users:** |
| 21 | +After installation, run the following command to manage Docker as a non-root user (this allows you to run Docker without `sudo`): |
| 22 | +```bash |
| 23 | +sudo usermod -aG docker $USER |
| 24 | +``` |
| 25 | + |
| 26 | +Note: You must log out and log back in for this change to take effect. |
| 27 | + |
| 28 | +**For macOS Users:** |
| 29 | +If you are using Docker Desktop for macOS 12.2 or later, we highly recommend enabling [virtiofs](https://www.docker.com/blog/speed-boost-achievement-unlocked-on-docker-desktop-4-6-for-mac/) for a significant performance boost. |
| 30 | + |
| 31 | +Note: Enabled by default since Docker Desktop v4.22. |
| 32 | + |
| 33 | +## Setting up the DEV environment |
| 34 | +1. Clone this repository from GitHub. |
| 35 | + |
| 36 | +2. Edit and set `XDEBUG_CONFIG=` inside `.env` file (optional, by default `XDEBUG_CONFIG=main`). |
| 37 | + |
| 38 | +3. Configure `/docker/dev/xdebug-main.ini` (Linux/Windows) or `/docker/dev/xdebug-osx.ini` (MacOS) (optional). |
| 39 | + |
| 40 | +4. Build, start and install the docker images from your terminal: |
| 41 | +```bash |
| 42 | +make build-dev |
| 43 | +make start |
| 44 | +make setup |
| 45 | +``` |
| 46 | + |
| 47 | +## Accessing Container Shells |
| 48 | +Once the application is running (via `make start`), you can easily access the command line inside your containers. |
| 49 | + |
| 50 | +To open a shell inside the container, run: |
| 51 | +```bash |
| 52 | +make ssh |
| 53 | +``` |
| 54 | + |
| 55 | +Tip: Type `exit` and press Enter to leave the container's shell and return to your local terminal. |
| 56 | + |
| 57 | +## Rebuilding Containers |
| 58 | +If you modify any `Dockerfile` or environment configurations, you will need to rebuild the containers using the following commands: |
| 59 | +```bash |
| 60 | +make down |
| 61 | +make build-dev |
| 62 | +make start |
| 63 | +``` |
| 64 | + |
| 65 | +## Starting and Stopping Containers |
| 66 | +Use the following commands to start or stop the development environment: |
| 67 | +```bash |
| 68 | +make start |
| 69 | +make stop |
| 70 | +``` |
| 71 | + |
| 72 | +## Stopping and Removing Containers |
| 73 | +To completely stop and remove all environment containers and networks, use the following command: |
| 74 | +```bash |
| 75 | +make down |
| 76 | +``` |
| 77 | + |
| 78 | +## Available Makefile Commands |
| 79 | +Here is a reference list of the primary commands available for managing the environment, databases, logs and testing: |
| 80 | +```bash |
| 81 | +make build-dev |
| 82 | + |
| 83 | +make start |
| 84 | + |
| 85 | +make stop |
| 86 | + |
| 87 | +make down |
| 88 | + |
| 89 | +make restart |
| 90 | + |
| 91 | +make ssh |
| 92 | +make ssh-root |
| 93 | + |
| 94 | +make setup |
| 95 | + |
| 96 | +make update |
| 97 | + |
| 98 | +make composer-audit |
| 99 | + |
| 100 | +make info |
| 101 | +make help |
| 102 | + |
| 103 | +make phar |
| 104 | +make signed-phar |
| 105 | + |
| 106 | +make phpunit |
| 107 | +make phpcs |
| 108 | +make ecs |
| 109 | +make ecs-fix |
| 110 | +make phpstan |
| 111 | + |
| 112 | +make phpcpd-run |
| 113 | +make phpcpd-html-report |
| 114 | + |
| 115 | +make logs |
| 116 | +``` |
| 117 | +Note: For a complete list of all available commands, please inspect the `Makefile` directly or run `make help`. |
| 118 | + |
| 119 | +## Architecture & packages |
| 120 | +* [cli-parser](https://packagist.org/packages/sebastian/cli-parser) |
| 121 | +* [version](https://packagist.org/packages/sebastian/version) |
| 122 | +* [php-file-iterator](https://packagist.org/packages/phpunit/php-file-iterator) |
| 123 | +* [php-timer](https://packagist.org/packages/phpunit/php-timer) |
| 124 | +* [phpunit](https://packagist.org/packages/phpunit/phpunit) |
| 125 | +* [composer-bin-plugin](https://packagist.org/packages/bamarni/composer-bin-plugin) |
| 126 | +* [security-advisories](https://packagist.org/packages/roave/security-advisories) |
| 127 | +* [easy-coding-standard](https://packagist.org/packages/symplify/easy-coding-standard) |
| 128 | +* [phpstan](https://packagist.org/packages/phpstan/phpstan) |
| 129 | +* [php-coveralls](https://github.com/php-coveralls/php-coveralls) |
| 130 | + |
| 131 | +## Guidelines |
| 132 | +* [Report](https://github.com/systemsdk/phpcpd/blob/master/docs/report.md) |
| 133 | +* [Schema](https://github.com/systemsdk/phpcpd/blob/master/docs/schema.md) |
| 134 | +* [Phive](https://github.com/phar-io/phive) |
| 135 | +* [Phing](https://www.phing.info) |
| 136 | +* [Xalan](https://xalan.apache.org) |
| 137 | + |
| 138 | +## Development Workflow |
| 139 | +1. **Branching:** Create a new branch from `develop` using one of the following patterns: |
| 140 | + * `feature/{ticketNo}` |
| 141 | + * `bugfix/{ticketNo}` |
| 142 | +2. **Commits:** Commit frequently and write clear, descriptive commit messages to facilitate the review process. |
| 143 | +3. **Pull Request:** Push your branch to the repository and open a Pull Request (PR) against the `develop` branch. Use the following naming convention for your PR: `feature/{ticketNo} - Short descriptive title of the Jira task`. |
| 144 | +4. **Review:** Address any feedback from reviewers and iterate as needed. |
| 145 | +5. **CI/CD Checks:** Ensure that all continuous integration checks (e.g., GitHub Actions) pass successfully and the build status is green. |
| 146 | +6. **Merge:** Once approved, your PR will be squashed and merged into `develop`. It will later be merged into a `release/{version}` branch for deployment. |
| 147 | + |
| 148 | +Note: For a detailed visual guide on this branching model, please refer to the [Git Flow Cheatsheet](https://danielkummer.github.io/git-flow-cheatsheet). |
0 commit comments