2017 © Pedro Peláez
 

luya-core luya-deployer

This is the LUYA recipe to deploy an application with Deployer, the Deployment Tool for PHP.

image

luyadev/luya-deployer

This is the LUYA recipe to deploy an application with Deployer, the Deployment Tool for PHP.

  • Monday, April 16, 2018
  • by nadar
  • Repository
  • 5 Watchers
  • 4 Stars
  • 9,106 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 8 Versions
  • 12 % Grown

The README.md

LUYA Logo , (*1)

LUYA Deployer

LUYA Total Downloads Latest Stable Version Join the chat at https://gitter.im/luyadev/luya, (*2)

This is the recipe to deploy your LUYA Website with PHP Deployer., (*3)

Version 3.0 of LUYA Deployer is compatible with PHP Deployer 7, (*4)

Install

Add the deployer composer package to your project:, (*5)

composer require luyadev/luya-deployer --dev

Create a deploy.php file with the content of your host configuration(s) and store it in the root directory of your project:, (*6)

<?php
namespace Deployer;

require 'vendor/luyadev/luya-deployer/luya.php';

// define your configuration here
host('SSHHOST.COM')
    ->setLabels(['stage' => 'prod'])
    ->set('remote_user', 'SSHUSER')
    ->set('deploy_path', '~/httpdocs');

set('repository', 'https://USER:PASSWORD@github.com/VENDOR/REPO.git');

To deploy to the above configured server just go into the console and run:, (*7)

./vendor/bin/dep luya prod

The LUYA Deployer will now deploy the to the above host with prod Config. The stage() method determines which Config ENV should be taken, therefore those values must correlate each other., (*8)

Configure Hosting

In order to run your website, you have to modify the root directory of your website to current/public_html folder. Deployer will create the following folders:, (*9)

  • current
  • releases
  • shared

Those folders are located in your defined deploy_path folder. So the current/public_html should be the only directory visible by the web., (*10)

Options

Several options and can be defined with set(OPTION, VALUE). Its recommend to set the define the option for a given server:, (*11)

host('luya.io')
    ->stage('prod')
    ->set(COMPOSER_IGNORE_PLATFORM_REQS, true)
    ->set('deploy_path', '~/httpdocs');

Available Options, (*12)

Key Constant Default Description
ignorePlatformReqs COMPOSER_IGNORE_PLATFORM_REQS false Whether composer install should ignore platform requirements or not.
adminCoreCommands LUYA_ADMIN_CORE_COMMANDS true Whether the LUYA core commands like migrate, import should be run after deployment.

In order to configure a branch to deploy use set('branch', 'myCheckoutBranch');, (*13)

Unglue

In order to use unglue you can add after('luya:commands', 'unglue'); in your deploy.php. This will download the unglue phar file and compile the files according to the .unglue file., (*14)

Authorization Password / SSH Key

Since the password() method has been removed, authentication can either be done using SSH Keys or by entering the password while deployment. The dep luya prod command will prompt for the users password unless he could not connect by SSH Key. By default the ~/.ssh/id_rsa will be taken to make a first attempt. You can configure ssh settings with the following methods:, (*15)

->configFile('~/.ssh/config')
->identityFile('~/.ssh/id_rsa')
->forwardAgent(true)
->multiplexing(true)

Read the PHP Deployer Docs for more informations. As we can not cover everything about SSH Keys but a here is a very basic example setup. First you have to create an SSH key, then the Server you'd like to connect must have stored the public key .pub file. So you should never publish the private key but the public key can be stored on the Server:, (*16)

  1. Generate an SSH Key ssh-keygen -t rsa -b 2048 -C "luyadeployer"
  2. When prompting for Enter passphrase (empty for no passphrase): skip this step (at least when setting up an continuous deployment f.e.).
  3. Copy the content of ~/.ssh/id_rsa.pub which is the public key.
  4. Add the public key to ~/.ssh/authorized_keys on the Server or use ssh-copy-id. Also Plesk f.e. has visual tools to do so Plesk SSH Keys Extension

The Versions

16/04 2018

dev-master

9999999-dev https://luya.io

This is the LUYA recipe to deploy an application with Deployer, the Deployment Tool for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

php yii2 deployer luya luya-module

16/04 2018

1.0.5.1

1.0.5.1 https://luya.io

This is the LUYA recipe to deploy an application with Deployer, the Deployment Tool for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

php yii2 deployer luya luya-module

16/04 2018

1.0.5

1.0.5.0 https://luya.io

This is the LUYA recipe to deploy an application with Deployer, the Deployment Tool for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

php yii2 deployer luya luya-module

28/03 2018

1.0.4

1.0.4.0 https://luya.io

This is the LUYA recipe to deploy an application with Deployer, the Deployment Tool for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

php yii2 deployer luya luya-module

22/01 2018

1.0.3

1.0.3.0 https://luya.io

This is the LUYA recipe to deploy an application with Deployer, the Deployment Tool for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

php yii2 deployer luya luya-module

24/10 2017

1.0.2

1.0.2.0 https://luya.io

This is the LUYA recipe to deploy an application with Deployer, the Deployment Tool for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

php yii2 deployer luya luya-module

04/05 2017

1.0.1

1.0.1.0 https://luya.io

This is the LUYA recipe to deploy an application with Deployer, the Deployment Tool for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

php yii2 deployer luya luya-module

11/04 2017

1.0.0

1.0.0.0 https://luya.io

This is the LUYA recipe to deploy an application with Deployer, the Deployment Tool for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

php yii2 deployer luya luya-module