Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
BelleNottelling authored and admdly committed Nov 27, 2023
1 parent 3559cca commit cea2260
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
22 changes: 16 additions & 6 deletions pages/docs/contribution-handbook/developer-workflow/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ ADD . /var/www/fossbilling

Run the following command to build and start the containers:

```
```shell
docker-compose up --build -d
```

You can now interact with the containers via Docker Desktop.

To destroy the containers via command line, run:

```
```shell
docker-compose down --volumes
```

Expand All @@ -112,7 +112,7 @@ Use Docker Desktop to access the `Terminal` for the `web` container.

Run the following commands:

```
```shell
cd /var/www/fossbilling
composer install
npm install
Expand All @@ -131,12 +131,22 @@ Use `mysql` as the database hostname, and `fossbilling` for the database name, u
Keep this in mind if you are rapidly re-creating the development environment or reinstalling FOSSBilling.
</Callout>

### Running Tests
#### PHPunit

Use the following command in the `web` container to run `phpunit` tests:
FOSSBilling's unit tests are built using PHPUnit, to run them simply run the command below.

```shell
php /var/www/fossbilling/src/vendor/bin/phpunit
```
php /var/www/fossbilling/src/vendor/phpunit/phpunit/phpunit

#### PHPStan

PHPStan performs static analysis on your PHP code. It will check for common mistakes such as wrong types being used, incorrect PHPDocs, references to undefined functions, and more.

You may need to increase the memory limit when running PHPStan, in this case we've set it to 512MB as an example which is more than enough.

```shell
php /var/www/fossbilling/src/vendor/bin/phpstan --memory-limit-512m
```

## Summary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ All methods involve copying the `src/` folder from your local repository into th

Utilize [rsync](https://linux.die.net/man/1/rsync) via command line to sync only files that have changed.

```
```shell
rsync -ahP src/ user@domainorip:/path/to/www
```

Add the `-I` flag to force sync all files regardless of changes:

```
```shell
rsync -ahPI src/ user@domainorip:/path/to/www
```

To skip uploading the `src/install` folder, use the `--exclude` flag:

```
```shell
rsync -ahPI --exclude 'src/install' src/ user@domainorip:/path/to/www
```

Expand Down

0 comments on commit cea2260

Please sign in to comment.