2021-09-26 15:25:58 +02:00
|
|
|
|
<!-- DO NOT EDIT THIS FILE! -->
|
|
|
|
|
<!-- Instead edit recipe/silverstripe.php -->
|
|
|
|
|
<!-- Then run bin/docgen -->
|
|
|
|
|
|
2022-09-12 11:40:11 +02:00
|
|
|
|
# How to Deploy a Silverstripe Project
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
2022-09-12 12:29:44 +02:00
|
|
|
|
```php
|
|
|
|
|
require 'recipe/silverstripe.php';
|
|
|
|
|
```
|
|
|
|
|
|
2021-09-26 15:25:58 +02:00
|
|
|
|
[Source](/recipe/silverstripe.php)
|
|
|
|
|
|
2022-09-12 11:40:11 +02:00
|
|
|
|
Deployer is a free and open source deployment tool written in PHP.
|
|
|
|
|
It helps you to deploy your Silverstripe application to a server.
|
|
|
|
|
It is very easy to use and has a lot of features.
|
|
|
|
|
|
|
|
|
|
Three main features of Deployer are:
|
|
|
|
|
- **Provisioning** - provision your server for you.
|
|
|
|
|
- **Zero downtime deployment** - deploy your application without a downtime.
|
|
|
|
|
- **Rollbacks** - rollback your application to a previous version, if something goes wrong.
|
|
|
|
|
|
|
|
|
|
Additionally, Deployer has a lot of other features, like:
|
|
|
|
|
- **Easy to use** - Deployer is very easy to use. It has a simple and intuitive syntax.
|
|
|
|
|
- **Fast** - Deployer is very fast. It uses parallel connections to deploy your application.
|
|
|
|
|
- **Secure** - Deployer uses SSH to connect to your server.
|
|
|
|
|
- **Supports all major PHP frameworks** - Deployer supports all major PHP frameworks.
|
|
|
|
|
|
|
|
|
|
You can read more about Deployer in [Getting Started](/docs/getting-started.md).
|
|
|
|
|
|
|
|
|
|
The [deploy](#deploy) task of **Silverstripe** consists of:
|
2024-10-22 10:24:42 +02:00
|
|
|
|
* [deploy:prepare](/docs/recipe/common.md#deploy-prepare) – Prepares a new release
|
|
|
|
|
* [deploy:info](/docs/recipe/deploy/info.md#deploy-info) – Displays info about deployment
|
|
|
|
|
* [deploy:setup](/docs/recipe/deploy/setup.md#deploy-setup) – Prepares host for deploy
|
|
|
|
|
* [deploy:lock](/docs/recipe/deploy/lock.md#deploy-lock) – Locks deploy
|
|
|
|
|
* [deploy:release](/docs/recipe/deploy/release.md#deploy-release) – Prepares release
|
|
|
|
|
* [deploy:update_code](/docs/recipe/deploy/update_code.md#deploy-update_code) – Updates code
|
2024-10-23 14:51:05 +02:00
|
|
|
|
* [deploy:env](/docs/recipe/deploy/env.md#deploy-env) – Configure .env file
|
2024-10-22 10:24:42 +02:00
|
|
|
|
* [deploy:shared](/docs/recipe/deploy/shared.md#deploy-shared) – Creates symlinks for shared files and dirs
|
|
|
|
|
* [deploy:writable](/docs/recipe/deploy/writable.md#deploy-writable) – Makes writable dirs
|
|
|
|
|
* [deploy:vendors](/docs/recipe/deploy/vendors.md#deploy-vendors) – Installs vendors
|
|
|
|
|
* [silverstripe:buildflush](/docs/recipe/silverstripe.md#silverstripe-buildflush) – Runs /dev/build?flush=all
|
|
|
|
|
* [deploy:publish](/docs/recipe/common.md#deploy-publish) – Publishes the release
|
|
|
|
|
* [deploy:symlink](/docs/recipe/deploy/symlink.md#deploy-symlink) – Creates symlink to release
|
|
|
|
|
* [deploy:unlock](/docs/recipe/deploy/lock.md#deploy-unlock) – Unlocks deploy
|
|
|
|
|
* [deploy:cleanup](/docs/recipe/deploy/cleanup.md#deploy-cleanup) – Cleanup old releases
|
|
|
|
|
* [deploy:success](/docs/recipe/common.md#deploy-success) – Deploys your project
|
2022-07-26 09:18:44 +02:00
|
|
|
|
|
|
|
|
|
|
2022-07-26 00:19:14 +02:00
|
|
|
|
The silverstripe recipe is based on the [common](/docs/recipe/common.md) recipe.
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
### shared_assets
|
2024-10-13 18:13:15 +00:00
|
|
|
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L13)
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
2024-10-13 21:08:48 +02:00
|
|
|
|
Silverstripe configuration
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
2022-09-12 12:53:42 +02:00
|
|
|
|
```php title="Default value"
|
|
|
|
|
if (test('[ -d {{release_or_current_path}}/public ]') || test('[ -d {{deploy_path}}/shared/public ]')) {
|
|
|
|
|
return 'public/assets';
|
|
|
|
|
}
|
|
|
|
|
return 'assets';
|
|
|
|
|
```
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### shared_dirs
|
2024-10-13 18:13:15 +00:00
|
|
|
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L22)
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
2021-10-18 18:29:14 +02:00
|
|
|
|
Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/deploy/shared.php`.
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
|
|
Silverstripe shared dirs
|
|
|
|
|
|
|
|
|
|
```php title="Default value"
|
|
|
|
|
[
|
2024-10-13 18:13:15 +00:00
|
|
|
|
'{{shared_assets}}',
|
2021-09-26 15:25:58 +02:00
|
|
|
|
]
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### writable_dirs
|
2024-10-13 18:13:15 +00:00
|
|
|
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L27)
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
|
|
Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `recipe/deploy/writable.php`.
|
|
|
|
|
|
|
|
|
|
Silverstripe writable dirs
|
|
|
|
|
|
|
|
|
|
```php title="Default value"
|
|
|
|
|
[
|
2024-10-13 18:13:15 +00:00
|
|
|
|
'{{shared_assets}}',
|
2021-09-26 15:25:58 +02:00
|
|
|
|
]
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### silverstripe_cli_script
|
2024-10-13 18:13:15 +00:00
|
|
|
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L32)
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
|
|
Silverstripe cli script
|
2022-09-12 12:53:42 +02:00
|
|
|
|
:::info Autogenerated
|
|
|
|
|
The value of this configuration is autogenerated on access.
|
|
|
|
|
:::
|
|
|
|
|
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Tasks
|
|
|
|
|
|
2024-10-22 10:28:50 +02:00
|
|
|
|
### silverstripe\:build {#silverstripe-build}
|
2024-10-13 18:13:15 +00:00
|
|
|
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L48)
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
2021-11-08 22:59:39 +01:00
|
|
|
|
Runs /dev/build.
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
|
|
Helper tasks
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 10:28:50 +02:00
|
|
|
|
### silverstripe\:buildflush {#silverstripe-buildflush}
|
2024-10-13 18:13:15 +00:00
|
|
|
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L53)
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
2021-11-08 22:59:39 +01:00
|
|
|
|
Runs /dev/build?flush=all.
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 10:24:42 +02:00
|
|
|
|
### deploy {#deploy}
|
2024-10-13 18:13:15 +00:00
|
|
|
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L61)
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
2021-11-08 22:59:39 +01:00
|
|
|
|
Deploys your project.
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
|
|
Main task
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This task is group task which contains next tasks:
|
2024-10-22 10:24:42 +02:00
|
|
|
|
* [deploy:prepare](/docs/recipe/common.md#deploy-prepare)
|
|
|
|
|
* [deploy:vendors](/docs/recipe/deploy/vendors.md#deploy-vendors)
|
|
|
|
|
* [silverstripe:buildflush](/docs/recipe/silverstripe.md#silverstripe-buildflush)
|
|
|
|
|
* [deploy:publish](/docs/recipe/common.md#deploy-publish)
|
2021-09-26 15:25:58 +02:00
|
|
|
|
|
|
|
|
|
|