Back to Deployer

How to Deploy a Spiral Project

docs/recipe/spiral.md

8.0.38.0 KB
Original Source
<!-- DO NOT EDIT THIS FILE! --> <!-- Instead edit recipe/spiral.php --> <!-- Then run bin/docgen -->

How to Deploy a Spiral Project

php
require 'recipe/spiral.php';

Source

Deployer is a free and open source deployment tool written in PHP. It helps you to deploy your Spiral 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.

The deploy task of Spiral consists of:

The spiral recipe is based on the common recipe.

Configuration

shared_dirs

Source

Overrides shared_dirs from recipe/deploy/shared.php.

Spiral shared dirs

php
['runtime']

writable_dirs

Source

Overrides writable_dirs from recipe/deploy/writable.php.

Spiral writable dirs

php
['runtime', 'public']

roadrunner_path

Source

Path to the RoadRunner server

php
'{{release_or_current_path}}'

dotenv_example

Source

Overrides dotenv_example from recipe/deploy/env.php.

php
'.env.sample'

Tasks

spiral:configure {#spiral-configure}

Source

Configure project.

Spiral Framework console commands

spiral:cycle {#spiral-cycle}

Source

Update (init) cycle schema from database and annotated classes.

spiral:migrate {#spiral-migrate}

Source

Perform all outstanding migrations.

spiral:update {#spiral-update}

Source

Update project state.

spiral:cache:clean {#spiral-cache-clean}

Source

Clean application runtime cache.

spiral:i18n:reset {#spiral-i18n-reset}

Source

Reset translation cache.

spiral:encrypt-key {#spiral-encrypt-key}

Source

Generate new encryption key, if it doesn't exist.

spiral:views:compile {#spiral-views-compile}

Source

Warm-up view cache.

spiral:views:reset {#spiral-views-reset}

Source

Clear view cache.

cycle:migrate {#cycle-migrate}

Source

Generate ORM schema migrations.

Cycle ORM and migrations console commands

cycle:render {#cycle-render}

Source

Render available CycleORM schemas.

cycle:sync {#cycle-sync}

Source

Sync Cycle ORM schema with database without intermediate migration (risk operation).

migrate:init {#migrate-init}

Source

Init migrations component (create migrations table).

migrate:replay {#migrate-replay}

Source

Replay (down, up) one or multiple migrations.

migrate:rollback {#migrate-rollback}

Source

Rollback one (default) or multiple migrations.

migrate:status {#migrate-status}

Source

Get list of all available migrations and their statuses.

roadrunner:serve {#roadrunner-serve}

Source

Start RoadRunner server.

RoadRunner console commands

roadrunner:stop {#roadrunner-stop}

Source

Stop RoadRunner server.

roadrunner:reset {#roadrunner-reset}

Source

Reset workers of all services.

deploy:download-rr {#deploy-download-rr}

Source

Download RoadRunner.

Download and restart RoadRunner

deploy:restart-rr {#deploy-restart-rr}

Source

Restart RoadRunner.

deploy {#deploy}

Source

Deploys your project.

Main task

This task is group task which contains next tasks: