Skip to content

🏇 FTP deployment (by @dg) extension for Nette Framework

Notifications You must be signed in to change notification settings

DepkaCZ/deployer-extension

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deployer Extension

Ftp-Deployment Extension for Nette.


Build Status Code coverage Total downloads Latest stable HHVM Status

Discussion / Help

Join the chat

Install

$ composer require minetro/deployer-extension

Configuration

Register extension

extensions:
    deployer: Minetro\Deployer\DI\DeployerExtension

Configure extension

Detailed configuration is described here ftp-deployment.

parameters:
    deploy:
        protocol: ftp # ftp|ftps
        user: user1
        password: mysecretpwd
        scheme: example.com # example.com/www     

deployer:
    config:
        mode: run
        logFile: %appDir%/log/deployer.log
        tempDir: %appDir%/temp
        colors: off
        
    # User specific variables
    userdata: 

    # Plugins specification (see more in PLUGINS.md)
    plugins:
        
    # Web sections
    sections:
        web1:
            remote: %deploy.protocol%://%deploy.user%:%deploy.password%@%deploy.scheme%
            local: %wwwDir%
            testMode: false

            allowdelete: on
            passiveMode: on
            preprocess: off

            ignore:
                # Common
                - .git*
                - .idea*
                - .bowerrc
                - composer.*
                - bower.json
                - gulpfile.js
                - package.json

                # Application
                - /app/config/config.local.neon
                - /bin
                - /tests
                - /node_modules
                - /log/*
                - "!/log/.htaccess"
                - /temp/*
                - "!/temp/.htaccess"

                # Public
                - /www/*.scss
                - /www/*.less
                - /www/temp
                - /www/uploaded
                - /www/stats

            before:
                #- [@\TestBeforeListener, onBefore]
            after:
                #- [@\TestAfterListener, onAfter]

            purge:
                - temp/cache
                - temp/myfolder

More webs <=> more sections

deployer:
    section:
        example.com:
            ...
        test.cz:
            ...

Listeners

You can register service which implement AfterListener or BeforeListener.

Example you can find here.

Or in special PLUGINS.md readme file.

Deploy

See example scripts here.

Automatic

Config is automatic passed via extension.

# Create Deploy Manager
$dm = $container->getByType('Minetro\Deployer\Manager');
$dm->deploy();

Manual

You have to create your configuration by yourself.

# Create config
$config = new Config();
$config->setLogFile(..);
$config->setMode(..);

$section = new Section();
$section->setName(..);
$config->addSection($section);
# Create Deploy Manager
$dm = $container->getByType('Minetro\Deployer\Manager');
$dm->manualDeploy($config);
# Inject Deploy Manager
use Minetro\Deployer;

/** @var Deployer\Manager @inject */
public $dm;

public function actionDeploy() 
{
    $this->dm->manulDeploy($config);
}

Prepared deploy script (deploy.php & deploy)

Place it by yourself (for example root/deploy.php). Be careful about local and tempDir, there depend on location.

require __DIR__ . '/vendor/autoload.php';

# Configurator
$configurator = new Nette\Configurator;
$configurator->setDebugMode(TRUE);
$configurator->enableDebugger(__DIR__ . '/../log');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()
    ->addDirectory(__DIR__)
    ->register();

# Configs
$configurator->addConfig(__DIR__ . '/config/config.neon');

# Create DI Container
$container = $configurator->createContainer();

# Create Deploy Manager
$dm = $container->getByType('Minetro\Deployer\Manager');
$dm->deploy();

About

🏇 FTP deployment (by @dg) extension for Nette Framework

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.8%
  • Shell 0.2%