-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
142 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Deployments Advanced | ||
|
||
## Customising Deployments | ||
|
||
You can customise the deployment process by creating a custom `deploy.php` file in your site directory. This file will be executed instead of the default `deploy.php` file in the `site/modules/RockMigrations` folder. | ||
|
||
A good example are translations. ProcessWire stores translations in `/site/assets/files/{languageID}/...`. When having multiple environments (dev/staging/production), where do you translate your translatable strings? | ||
|
||
I recommend to handle translations just like code features. This means we work on them on development and then push them to staging or production. | ||
|
||
Now we have a problem, because usually during deployments we exclude `/site/assets/files` from the deployment process to not lose any user data. How to solve this? | ||
|
||
We can tell RockMigrations to `push` certain directories during the deployment process, which will make sure that if we change translations on development, they are also pushed to staging and production: | ||
|
||
```php | ||
<?php | ||
|
||
namespace RockMigrations; | ||
|
||
$deploy = new Deployment($argv ?? []); | ||
|
||
$deploy->push("site/assets/files/1030"); // german translations | ||
$deploy->push("site/assets/files/1031"); // english translations | ||
|
||
$deploy->run(); | ||
``` | ||
|
||
This will tell RockMigrations to grab those folders from the checked out repository and push them to the remote server, overwriting any existing files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// rmf-checkbox | ||
$1 => [ | ||
return [ | ||
'type' => 'checkbox', | ||
'label' => '$2', | ||
], | ||
'label' => '$1', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// Add an image field via RockMigrations | ||
$1 => [ | ||
return [ | ||
'type' => 'datetime', | ||
'label' => '$2', | ||
'label' => '$1', | ||
'dateOutputFormat' => 'd.m.Y H:i', | ||
'inputType' => 'text', | ||
'dateSelectFormat' => 'yMd', | ||
'datepicker' => InputfieldDatetime::datepickerFocus, | ||
'dateInputFormat' => 'j.n.y', | ||
'timeInputFormat' => 'H:i', | ||
'defaultToday' => 1, | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
// Add a fieldset (open+close) | ||
$1 => [ | ||
return [ | ||
'type' => 'FieldsetOpen', | ||
'label' => '$2', | ||
'icon' => '$3', | ||
], | ||
$1 . "_END" => [ | ||
'type' => 'FieldsetClose', | ||
], | ||
'label' => '$1', | ||
'icon' => '$2', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
// Add a files field via RockMigrations | ||
$1 => [ | ||
return [ | ||
'type' => 'file', | ||
'label' => '$2', | ||
'maxFiles' => $4, | ||
'descriptionRows' => $5, | ||
'extensions' => '${6:mp4 pdf xlsx}', | ||
'label' => '$1', | ||
'maxFiles' => $2, | ||
'descriptionRows' => $3, | ||
'extensions' => '${4:mp4 pdf xlsx}', | ||
'icon' => 'files-o', | ||
'outputFormat' => FieldtypeFile::outputFormatArray, | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// Add an image field via RockMigrations | ||
$1 => [ | ||
return [ | ||
'type' => 'image', | ||
'label' => '$2', | ||
'maxFiles' => $4, | ||
'descriptionRows' => $5, | ||
'extensions' => '${6:jpg jpeg gif png svg}', | ||
'maxSize' => ${7:3}, // max 3 megapixels | ||
'label' => '$1', | ||
'maxFiles' => $2, | ||
'descriptionRows' => $3, | ||
'extensions' => '${4:jpg jpeg gif png svg}', | ||
'maxSize' => ${5:3}, // max 3 megapixels | ||
'okExtensions' => ['svg'], | ||
'icon' => 'picture-o', | ||
'outputFormat' => FieldtypeFile::outputFormatSingle, | ||
'gridMode' => 'grid', // grid, left, list | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// rmf-imagepicker | ||
$1 => [ | ||
return [ | ||
'type' => 'RockImagePicker', | ||
'label' => '$2', | ||
'sourcepage' => ${3:1}, | ||
'sourcefield' => '${4:yourfieldname}', | ||
], | ||
'label' => '$1', | ||
'sourcepage' => ${2:1}, | ||
'sourcefield' => '${3:yourfieldname}', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Add an integer field via RockMigrations | ||
$1 => [ | ||
return [ | ||
'type' => 'integer', | ||
'label' => '$3', | ||
'label' => '$1', | ||
'icon' => 'list-ol', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Add a RockMoney field via RockMigrations | ||
$1 => [ | ||
return [ | ||
'type' => 'RockMoney', | ||
'label' => '$2', | ||
'label' => '$1', | ||
'icon' => 'money', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// Add a options field via RockMigrations | ||
$1 => [ | ||
return [ | ||
'type' => 'options', | ||
'label' => '$2', | ||
'label' => '$1', | ||
'icon' => 'cubes', | ||
'options' => [ | ||
1 => 'ONE|This is option one', | ||
2 => 'TWO', | ||
3 => 'THREE', | ||
], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
// Add a page field via RockMigrations | ||
$1 => [ | ||
return [ | ||
'type' => 'page', | ||
'label' => '$2', | ||
'derefAsPage' => ${4:FieldtypePage::derefAsPageOrFalse}, | ||
'inputfield' => ${5:'InputfieldPageListSelect'}, | ||
'findPagesSelector' => '${6:id>0,template!=admin}', | ||
'labelFieldName' => ${7:'title'}, | ||
], | ||
'label' => '$1', | ||
'derefAsPage' => ${2:FieldtypePage::derefAsPageOrFalse}, | ||
// inputfield options: | ||
// - InputfieldSelect // Select | ||
// - InputfieldRadios // Radio Buttons | ||
// - InputfieldPageListSelect // Page List Select | ||
// - InputfieldPageAutocomplete // Page Auto Complete (single) | ||
// - InputfieldTextTags // Text Tags (single) | ||
// - InputfieldSelectMultiple // Select Multiple | ||
// - InputfieldCheckboxes // Checkboxes | ||
// - InputfieldAsmSelect // AsmSelect | ||
// - InputfieldPageAutocomplete // Page Auto Complete | ||
// - InputfieldTextTags // Text Tags | ||
// - InputfieldPageListSelectMultiple // Page List Select Multiple | ||
'inputfield' => ${3:'InputfieldPageListSelect'}, | ||
'findPagesSelector' => '${4:id>0,template!=admin}', | ||
'labelFieldName' => '${5:title}', | ||
'icon' => '${6:link}', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Add a RockGrid field via RockMigrations | ||
$1 => [ | ||
return [ | ||
'type' => 'RockGrid', | ||
'label' => '$3', | ||
'grid' => '$4', | ||
'icon' => '${5:table}', | ||
], | ||
'label' => '$1', | ||
'grid' => '$2', | ||
'icon' => '${3:table}', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Add a RockIcons field via RockMigrations | ||
$1 => [ | ||
return [ | ||
'type' => 'text', | ||
'inputfieldClass' => 'InputfieldRockIcons', | ||
'label' => '$2', | ||
], | ||
'label' => '$1', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Add a RockPageBuilder field via RockMigrations | ||
$1 => [ | ||
return [ | ||
'type' => 'RockPageBuilder', | ||
'label' => '$2', | ||
'label' => '$1', | ||
'icon' => 'cubes', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// Add a text field via RockMigrations | ||
$1 => [ | ||
'type' => 'text', | ||
'label' => '$3', | ||
return [ | ||
'type' => 'text', // use text*Language to create a multi-lang field | ||
'label' => '$1', | ||
'icon' => 'align-left', | ||
'textformatters' => [ | ||
'TextformatterEntities', | ||
], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// Add a TinyMCE field via RockMigrations | ||
$1 => [ | ||
'type' => 'textarea', | ||
return [ | ||
'type' => 'textarea', // use textarea*Language to create a multi-lang field | ||
'inputfieldClass' => 'InputfieldTinyMCE', | ||
'contentType' => FieldtypeTextarea::contentTypeHTML, | ||
'label' => '$3', | ||
'rows' => ${4:5}, | ||
'icon' => '${5:align-left}', | ||
'label' => '$1', | ||
'rows' => ${2:5}, | ||
'icon' => '${3:align-left}', | ||
'inlineMode' => true, | ||
// 'rpb-nolabel' => true, // hide label in backend | ||
'settingsFile' => '/site/modules/RockMigrations/TinyMCE/simple.json', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Add a textarea field via RockMigrations | ||
$1 => [ | ||
'type' => 'textarea', | ||
'label' => '$3', | ||
'rows' => ${4:5}, | ||
'icon' => '${5:align-left}', | ||
], | ||
return [ | ||
'type' => 'textarea', // use textarea*Language to create a multi-lang field | ||
'label' => '$1', | ||
'rows' => ${2:5}, | ||
'icon' => '${3:align-left}', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// rmf-toggle | ||
$1 => [ | ||
return [ | ||
'type' => 'toggle', | ||
'label' => '$2', | ||
'label' => '$1', | ||
'formatType' => 0, // integer 0/1 | ||
'labelType' => 0, // yes/no | ||
'inputfieldClass' => 0, // toggle buttons | ||
'defaultOption' => 'yes', | ||
], | ||
]; |
Oops, something went wrong.