Skip to content

Commit

Permalink
Merge pull request #8 from BitBagCommerce/OP-536
Browse files Browse the repository at this point in the history
OP-536 - added installation.md - new standard
  • Loading branch information
senghe authored Sep 16, 2024
2 parents 620dc04 + 68f6974 commit 24f7b70
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:

-
name: Upload Behat logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: Behat logs
Expand Down
70 changes: 9 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ We have a 70-person team of experts: business analysts and consultants, eCommerc

* [Overview](#overview)
* [Installation](#installation)
* [Testing](#testing)
* [Functionalities](#functionalities)
* [Demo](#demo)
* [Additional resources for developers](#additional-resources-for-developers)
Expand All @@ -73,69 +72,18 @@ We have a 70-person team of experts: business analysts and consultants, eCommerc
The SyliusPocztaPolskaShippingExportPlugin allows integrating Sylius with Poczta Polska.

# Installation
---

```bash
composer require bitbag/poczta-polska-shipping-export-plugin
```

Add plugin dependencies to your config/bundles.php file:

```php
return [
...

BitBag\SyliusPocztaPolskaShippingExportPlugin\BitBagSyliusPocztaPolskaShippingExportPlugin::class => ['all' => true],
];
```

Import required config in your `config/packages/bitbag_shipping_export_plugin.yaml` file (if it doesn't exist):

```yaml
# config/packages/bitbag_shipping_export_plugin.yaml

imports:
...
The installation process for the `PocztaPolskaShippingExportPlugin` can be found [here](doc/installation.md).

- { resource: "@BitBagSyliusShippingExportPlugin/Resources/config/config.yml" }
```
Import routing in your `config/routes/bitbag_shipping_export_plugin.yaml` file (if it doesn't exist):

```yaml
# config/routes/bitbag_shipping_export_plugin.yaml
...
bitbag_shipping_export_plugin:
resource: "@BitBagSyliusShippingExportPlugin/Resources/config/routing.yml"
prefix: /admin
```


Finish the installation by updating the database schema:
```
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
bin/console cache:clear
```
---
## Requirements

## Testing
Recommended Node version for testing = 14.*
We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.

```bash
composer install
cd tests/Application
yarn install
yarn run encore dev
bin/console doctrine:database:create --env=test
bin/console doctrine:schema:create --env=test
bin/console sylius:fixtures:load --env=test
APP_ENV=test symfony server:start --dir=public/
cd ../..
vendor/bin/behat
vendor/bin/phpspec run
```
| Package | Version |
|---------------|-----------------|
| PHP | \>=8.0 |
| sylius/sylius | 1.12.x - 1.13.x |
| MySQL | \>= 5.7 |

# Functionalities
---
Expand Down
102 changes: 102 additions & 0 deletions doc/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Installation

## Overview:
GENERAL
- [Requirements](#requirements)
- [Composer](#composer)
- [Basic configuration](#basic-configuration)
---
ADDITIONAL
- [Tests](#tests)
- [Known Issues](#known-issues)
---

## Requirements:
We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.

| Package | Version |
|---------------|-----------------|
| PHP | \>=8.0 |
| sylius/sylius | 1.12.x - 1.13.x |
| MySQL | \>= 5.7 |

## Composer:
```bash
composer require bitbag/poczta-polska-shipping-export-plugin
```

## Basic configuration:
Add plugin dependencies to your `config/bundles.php` file:

```php
# config/bundles.php

return [
...
BitBag\SyliusShippingExportPlugin\BitBagSyliusShippingExportPlugin::class => ['all' => true],
BitBag\SyliusPocztaPolskaShippingExportPlugin\BitBagSyliusPocztaPolskaShippingExportPlugin::class => ['all' => true],
];
```

Import required config in your `config/packages/bitbag_shipping_export_plugin.yaml` file (if it doesn't exist):

```yaml
# config/packages/bitbag_shipping_export_plugin.yaml

imports:
...
- { resource: "@BitBagSyliusShippingExportPlugin/Resources/config/config.yml" }
```
Import routing in your `config/routes/bitbag_shipping_export_plugin.yaml` file (if it doesn't exist):
```yaml
# config/routes/bitbag_shipping_export_plugin.yaml
bitbag_shipping_export_plugin:
resource: "@BitBagSyliusShippingExportPlugin/Resources/config/routing.yml"
prefix: /admin
```

### Update your database
First, please run legacy-versioned migrations by using command:
```bash
bin/console doctrine:migrations:migrate
```

After migration, please create a new diff migration and update database:
```bash
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
```
**Note:** If you are running it on production, add the `-e prod` flag to this command.

### Clear application cache by using command:
```bash
bin/console cache:clear
```
**Note:** If you are running it on production, add the `-e prod` flag to this command.

## Tests
Recommended Node version for testing = 14.*

To run the tests, execute the commands:
```bash
composer install
cd tests/Application
yarn install
yarn run encore dev
bin/console doctrine:database:create --env=test
bin/console doctrine:schema:create --env=test
bin/console sylius:fixtures:load --env=test
APP_ENV=test symfony server:start --dir=public/
cd ../..
vendor/bin/behat
vendor/bin/phpspec run
```

## Known issues
### Translations not displaying correctly
For incorrectly displayed translations, execute the command:
```bash
bin/console cache:clear
```

0 comments on commit 24f7b70

Please sign in to comment.