Skip to content

Commit f35edbf

Browse files
authored
Merge pull request #297 from poespas/feature/add-start-of-magento2-docs
Add start of documentation for Magento 2 application Hypernode Deploy
2 parents 6e672d1 + 0e11a75 commit f35edbf

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,74 @@
11
# Config for Magento 2
2+
3+
This is a sample configuration that suffices for most magento2 installations:
4+
5+
```php
6+
<?php
7+
8+
namespace Hypernode\DeployConfiguration;
9+
10+
$configuration = new ApplicationTemplate\Magento2(['en_US']);
11+
12+
$productionStage = $configuration->addStage('production', 'magento2.komkommer.store');
13+
$productionStage->addServer('appname.hypernode.io');
14+
15+
return $configuration;
16+
```
17+
18+
By using the Magento2 ApplicationTemplate, a bunch of default configuration gets set in Hypernode Deploy, and should work out-of-the-box for most magento 2 stores.
19+
20+
These are the steps that will be executed by running your deployment:
21+
22+
## Advanced
23+
24+
However, for advanced configurations you can override most steps and variables set my Hypernode Deploy:
25+
26+
### Static Content Locales
27+
28+
When the deployer runs `bin/magento static-content:deploy` it will require locales to know what to build, this variable is set for this. It is included when you run `new ApplicationTemplate\Magento2` or can be overriden with:
29+
30+
```php
31+
$this->setVariable('static_content_locales', 'nl_NL en_US');
32+
```
33+
34+
### Defining custom steps
35+
36+
You potentially need to add custom steps to the deployment, for example to build npm assets or do server actions after deployment.
37+
38+
```php
39+
task('node:install', static function () {
40+
run("npm ci");
41+
});
42+
43+
task('node:build', static function () {
44+
run('npm run build');
45+
});
46+
47+
// Add builder task to run in the pipeline, use addDeployTask to run on the server
48+
$configuration->addBuildTask('node:install');
49+
$configuration->addBuildTask('node:build');
50+
```
51+
52+
### Shared Files
53+
54+
Hypernode Deploy deploys to a new folder for every deployment, this way you compare changes, and roll back small releases. There are however some files and folders that need to be present throughout releases. Therefor we have `shared_files` and `shared_folders`. These are symlinked files and folders that are made in a shared directory and get symbolic linked between releases.
55+
56+
#### Override Files
57+
58+
```{note}
59+
If you add these files be aware that your new files will be empty on your first release.
60+
```
61+
62+
```php
63+
$configuration->addSharedFile('pub/sitemap_en_US.xml');
64+
```
65+
66+
#### Override Folders
67+
68+
```{note}
69+
If you add these folders be aware that your new folders will be empty on your first release.
70+
```
71+
72+
```php
73+
$configuration->addSharedFile('var/reports');
74+
```

0 commit comments

Comments
 (0)