deployer/docs/recipe/silverstripe.md
2024-10-23 15:09:55 +02:00

138 lines
4.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- DO NOT EDIT THIS FILE! -->
<!-- Instead edit recipe/silverstripe.php -->
<!-- Then run bin/docgen -->
# How to Deploy a Silverstripe Project
```php
require 'recipe/silverstripe.php';
```
[Source](/recipe/silverstripe.php)
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:
* [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
* [deploy:env](/docs/recipe/deploy/env.md#deploy-env) Configure .env file
* [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
The silverstripe recipe is based on the [common](/docs/recipe/common.md) recipe.
## Configuration
### shared_assets
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L13)
Silverstripe configuration
```php title="Default value"
if (test('[ -d {{release_or_current_path}}/public ]') || test('[ -d {{deploy_path}}/shared/public ]')) {
return 'public/assets';
}
return 'assets';
```
### shared_dirs
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L22)
Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/deploy/shared.php`.
Silverstripe shared dirs
```php title="Default value"
[
'{{shared_assets}}',
]
```
### writable_dirs
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L27)
Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `recipe/deploy/writable.php`.
Silverstripe writable dirs
```php title="Default value"
[
'{{shared_assets}}',
]
```
### silverstripe_cli_script
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L32)
Silverstripe cli script
:::info Autogenerated
The value of this configuration is autogenerated on access.
:::
## Tasks
### silverstripe\:build {#silverstripe-build}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L48)
Runs /dev/build.
Helper tasks
### silverstripe\:buildflush {#silverstripe-buildflush}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L53)
Runs /dev/build?flush=all.
### deploy {#deploy}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/silverstripe.php#L61)
Deploys your project.
Main task
This task is group task which contains next tasks:
* [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)