Contribute to Open Source. Search issue labels to find the right project for you!

add option to copy shared_files instead of creating symlink

Issue Type Feature Request
Deployer Version N/A
Local Machine OS N/A
Remote Machine OS N/A


e.g. define shared_files: app/config/parameters.yml and setup basic config. In Symfony setup will composer run post-install command: Incenteev\ParameterHandler\ScriptHandler::buildParameters and it will add other non defined variables from parameters.yml.dist to parameters.yml.

It is good habbit, to define only non changing variables in parameters.yml.

It is impossible now, because you are creating symlink to this file. Add option to simply copy files instead of symlinking.

This behaviour is used in capistrano deploy tool. I am switching from this tool

Updated 03/08/2017 10:41 2 Comments

Laravel, npm install, fresh & first deploy [Deployer\Exception\RuntimeException (-1)]



deployer 5.1.3 deployer recipes dev-master Local Mac Os Sierra Remote Ubuntu 16.04


namespace Deployer;

require 'recipe/laravel.php';
require 'recipe/npm.php';

task('deploy', [
    /* 'deploy:shared', */
    /* 'deploy:vendors', */
    /* 'deploy:writable', */
    /* 'artisan:storage:link', */
    /* 'artisan:view:clear', */
    /* 'artisan:cache:clear', */
    /* 'artisan:config:cache', */
    /* 'artisan:optimize', */
    /* 'deploy:symlink', */
    /* 'deploy:unlock', */
    /* 'cleanup', */

after('deploy:update_code', 'npm:install');

For an unknown reason I receive the following trace:

➤ Executing task deploy:update_code
✔ Ok [19s 945ms]

➤ Executing task npm:install
[xxx] > which npm
[xxx] < /usr/bin/npm
[xxx] > cd /var/www/test-deploy/releases/1 && /usr/bin/npm install
➤ Executing task deploy:failed
• done on [xxx]
✔ Ok [1ms]

[Deployer\Exception\RuntimeException (-1)]
  The command "cd /var/www/test-deploy/releases/1 && /usr/bin/npm install" failed.
  Exit Code: -1 (Unknown error)
  Host Name: xxx

Exception trace:
 () at /Volumes/xxx/code/xxx/xxx/vendor/deployer/deployer/src/Ssh/Client.php:95
 Deployer\Ssh\Client->run() at /Volumes/xxx/code/xxx/xxx/vendor/deployer/deployer/src/functions.php:297
 Deployer\run() at /Volumes/xxx/code/xxx/xxx/vendor/deployer/recipes/npm.php:23
 Deployer\Deployer::Deployer\{closure}() at n/a:n/a
 call_user_func() at /Volumes/xxx/code/xxx/xxx/vendor/deployer/deployer/src/Task/Task.php:82
 Deployer\Task\Task->run() at /Volumes/xxx/code/xxx/xxx/vendor/deployer/deployer/src/Executor/SeriesExecutor.php:63
 Deployer\Executor\SeriesExecutor->run() at /Volumes/xxx/code/xxx/xxx/vendor/deployer/deployer/src/Console/TaskCommand.php:142
 Deployer\Console\TaskCommand->execute() at /Volumes/xxx/code/xxx/xxx/vendor/symfony/console/Command/Command.php:264
 Symfony\Component\Console\Command\Command->run() at /Volumes/xxx/code/xxx/xxx/vendor/symfony/console/Application.php:869
 Symfony\Component\Console\Application->doRunCommand() at /Volumes/xxx/code/xxx/xxx/vendor/deployer/deployer/src/Console/Application.php:132
 Deployer\Console\Application->doRunCommand() at /Volumes/xxx/code/xxx/xxx/vendor/symfony/console/Application.php:223
 Symfony\Component\Console\Application->doRun() at /Volumes/xxx/code/xxx/xxx/vendor/symfony/console/Application.php:130
 Symfony\Component\Console\Application->run() at /Volumes/xxx/code/xxx/xxx/vendor/deployer/deployer/src/Deployer.php:320
 Deployer\Deployer::run() at phar:///usr/local/bin/dep/bin/dep:119
 require() at /usr/local/bin/dep:4

When I ssh on the remote server and cd into /var/www/test-deploy/release, I can see the node_modules directory with the packages inside.

If I run the very first deploy without the npm task, everything is running smooth and the second deploy will be successfully achieved with npm install and npm run production tasks.

Can I get some light, please?

The only hint I found is Deployer\Deployer::Deployer\{closure}() at n/a:n/a

Note: Using the yarn recipe (require 'recipe/yarn.php';) instead of npm works properly.

Updated 03/08/2017 10:34

Autocomplete install does not work in zsh

Issue Type Bug
Deployer Version 5.1.3
Local Machine OS Ubuntu 14.04.5 LTS
Remote Machine OS N/A


autocomplete install does not work. I guess I am missing some package, but maybe script should give me some clue what I am missing?

Steps to reproduce

$ dep autocomplete –install > ~/.deployer_completion && echo “source ~/.deployer_completion” >> ~/.zshrc $ source ~/.zshrc

Output log

/home/vytautas/.deployer_completion:47: command not found: complete

Updated 19/07/2017 13:33 14 Comments

No "type" attribute in generated "link" elements for stylesheets



When generating the link elements for CSS stylesheets, the “type” attribute is omitted.

Although not mandatory as per HTML 4.01 or 5 specification, it provides valuable information for the browser in case the HTTP server serves the CSS files without a Content-Type header.

At least with Internet Explorer 11, a link element with no type and a reference to a file served without a Content-Type header raises error “SEC7113: CSS was ignored due to mime type mismatch”.

Error Message & Stack Trace

Internet Explorer 11: SEC7113): CSS was ignored due to mime type mismatch


Copy the relevant section from webpack.config.js:

module.exports = {
    entry: {
        app: __dirname + '/src/app/core/index.module.js',
        vendor: __dirname + '/src/vendor.lib.js',
    output: {
        path: __dirname + "/dist",
        filename: '[name].bundle.js',
        chunkFilename: '[name].bundle.js',
        sourceMapFilename :'[name]'
    plugins: [
        new ExtractTextPlugin(
        new HtmlWebpackPlugin({
            filename: 'index.html',
            template: 'src/index.html',
            chunksSortMode: orderByList(['vendor', 'app']),
            title: 'Tree-shaking'
    module: {
        loaders: [{
            test: /\.html$/,
            loader: "html-loader",
            exclude: ['src/index.html']
        }, {
            test: /\.css$/,
            loader: ExtractTextPlugin.extract({fallback: "style-loader", use: "css-loader"})
    devtool: 'source-map',
    devServer: {
        contentBase: __dirname + "/src"

Copy your template file:

<!doctype html>
<html ng-app="myApp">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Site title</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width">
    <div top-bar></div>
    <div nav-bar></div>
    <div ui-view></div>


Internet Explorer 11, and a misconfigured HTTPD server that serves no Content-Type for common MIME types (CSS)

Updated 04/07/2017 08:52 1 Comments

Explore storing an error object, rather than directly capturing a stack trace


For asynchronous assertions we capture a stack trace before the assertion is run. Inspired by this comment by @alxandr we should explore storing an error object, and reading the stack trace later if it’s actually necessary:

… instead of passing the stack trace itself, an error object could be passed. This has less performance impact, because then the stack trace is only generated on demand (this might even be something that could improve the performance of your existing async tests).

See lib/test.js and lib/assert.js.

Updated 25/07/2017 20:10 8 Comments

Additional options to pass when executing writable job

Issue Type Feature Request
Deployer Version 5.0.1
Local Machine OS MacOS Sierra
Remote Machine OS Ubuntu 16.04


When setting writable on directories on remote server i used chmod/chgrp but i was getting following error:

chgrp: cannot dereference ‘sugar-deployment/vendor/bin/phpunit’: No such file or directory

I solved it by adding additional option to chmod or chgrp -h affect each symbolic link instead of any referenced file (useful only on systems that can change the ownership of a symlink)

run(“$sudo chown -RLh $httpUser $dirs”);

Which resulted in link to shared as well as shared content to be properly set.

Maybe there should be an easy way to add additional options to pass when executing writable commands ?

Updated 30/05/2017 01:24 4 Comments

List copied file types in `copy_dirs`

Issue Type Feature Request
Deployer Version -
Local Machine OS -
Remote Machine OS -


It would be nice to have an option to set just some file types to copy in copy_dirs directive. For example: set('copy_dirs', [ 'dist/*.js', 'dist/*.css' ]); Don’t know, maybe copy_files would be better with allowing concrete files as well (eg dist/abcd.css).

Updated 23/05/2017 17:45 1 Comments

Consistent Go naming for JSON fields


As discussed in and the naming of fields such as Total (as opposed to TotalCount) where the JSON name is total_count seems inconsistent and it would be nice to consolidate.

However, this is a breaking API change.

This issue has been opened to discuss the situation and see if it is worth breaking the API to have more consistency.

Updated 17/07/2017 17:18 12 Comments

Identify user mistakes in config

Issue Type Feature Request
Deployer Version next

Implement internal bookkeeping to help identify user mistakes like spelling errors or unused variables that may lead to unexpected behavior.

set('keep_relaeses', 5);

Shows an warning:

Unknown config `keep_relaeses`. Did you mean `keep_releases`?
Updated 04/07/2017 10:18 4 Comments

Recipe for using a plain function instead of `beforeEach` hook


In many cases you could just use a plain function instead of a beforeEach hook. In the below case it’s both more clear and less code.

import test from 'ava';

const setup = () => {

    return {
        unicorn: fn('unicorn')
        rainbow: fn('rainbow')

test('foo', t => {
    const {unicorn, rainbow} = setup();

test('bar', t => {
    const {unicorn, rainbow} = setup();

With beforeEach it would be:

import test from 'ava';

test.beforeEach(t => {

    t.context = {
        unicorn: fn('unicorn')
        rainbow: fn('rainbow')

test('foo', t => {
    const {unicorn, rainbow} = t.context;

test('bar', t => {
    const {unicorn, rainbow} = t.context;

Still, there are benefits of beforeEach too. They’re not mutually exclusive. beforeEach has benefits like supporting non-promise asynchronicity. Better output when a hook fails. Void hook usage doesn’t require a call in each test. And more.

Updated 13/08/2017 17:09 3 Comments

Fork me on GitHub