deployphp / recipes

Archived. Go to
https://github.com/deployphp/deployer/tree/master/contrib
MIT License
319 stars 203 forks source link

Configuration parameter `cachetool_args` does not exist. #191

Closed jamieburchell closed 4 years ago

jamieburchell commented 6 years ago
Q A
Issue Type Bug
Deployer Version 6.3.0
Recipes Version 6.1.4
Local Machine OS Win 10
Remote Machine OS CentOS 7.5 / PHP 5.6

Description

Getting an error at cachetool:clear:opcache Configuration parametercachetool_argsdoes not exist.

Steps to reproduce

dep deploy production

Content of deploy.php

<?php

namespace Deployer;

set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/vendor/deployer/recipes');

require 'recipe/composer.php';
require 'recipe/cachetool.php';

// Project name
set('application', 'Project X');

// Project repository
set('repository', 'git@bitbucket.org:x/x.git');

// Hosts
host('x')
    ->stage('production')
    ->user('deploy')
    ->set('deploy_path', '/var/www/vhosts/x')
    ->set('cachetool', '127.0.0.1:9000');

// Shared files/dirs between deploys
add('shared_dirs', [
    'web/app/cache',
    'web/app/upgrade',
    'web/app/uploads',
    'web/app/w3tc-config',
    'web/app/wfcache',
    'web/app/wflogs'
]);

// Copy config
task('enable_prod_config', function() {
    run('cp "{{release_path}}/.env.prod" "{{release_path}}/.env"');
})->onStage('production');
after('deploy:update_code', 'enable_prod_config');

// Clear opcache
after('deploy:symlink', 'cachetool:clear:opcache');

// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);

// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');

Output log

With enabled option for verbose output -vvv.

[localhost] > git rev-parse --abbrev-ref HEAD
[localhost] < master
✈︎ Deploying master on x.x.x.x
• done on [x.x.x.x]
➤ Executing task deploy:prepare
[x.x.x.x] > echo $0
[x.x.x.x] < ssh multiplexing initialization
[x.x.x.x] < bash
[x.x.x.x] > if [ ! -d /var/www/vhosts/x ]; then mkdir -p /var/www/vhosts/x; fi
[x.x.x.x] > if [ ! -L /var/www/vhosts/x/current ] && [ -d /var/www/vhosts/x/current ]; then echo 'true'; fi
[x.x.x.x] > cd /var/www/vhosts/x && if [ ! -d .dep ]; then mkdir .dep; fi
[x.x.x.x] > cd /var/www/vhosts/x && if [ ! -d releases ]; then mkdir releases; fi
[x.x.x.x] > cd /var/www/vhosts/x && if [ ! -d shared ]; then mkdir shared; fi
• done on [x.x.x.x]
✔ Ok [1s 481ms]
➤ Executing task deploy:lock
[x.x.x.x] > if [ -f /var/www/vhosts/x/.dep/deploy.lock ]; then echo 'true'; fi
[x.x.x.x] > touch /var/www/vhosts/x/.dep/deploy.lock
• done on [x.x.x.x]
✔ Ok [282ms]
➤ Executing task deploy:release
[x.x.x.x] > cd /var/www/vhosts/x && (if [ -h release ]; then echo 'true'; fi)
[x.x.x.x] > cd /var/www/vhosts/x && (if [ -d releases ] && [ "$(ls -A releases)" ]; then echo 'true'; fi)
[x.x.x.x] < true
[x.x.x.x] > cd /var/www/vhosts/x && (cd releases && ls -t -1 -d */)
[x.x.x.x] < 28/
[x.x.x.x] < 27/
[x.x.x.x] < 26/
[x.x.x.x] < 25/
[x.x.x.x] < 24/
[x.x.x.x] < 23/
[x.x.x.x] < 22/
[x.x.x.x] > cd /var/www/vhosts/x && (if [ -f .dep/releases ]; then echo 'true'; fi)
[x.x.x.x] < true
[x.x.x.x] > cd /var/www/vhosts/x && (tail -n 15 .dep/releases)
[x.x.x.x] < 20180418094032,14
[x.x.x.x] < 20180418094836,15
[x.x.x.x] < 20180418100644,16
[x.x.x.x] < 20180418101243,17
[x.x.x.x] < 20180425155615,18
[x.x.x.x] < 20180427101326,19
[x.x.x.x] < 20180427101737,20
[x.x.x.x] < 20180604121026,21
[x.x.x.x] < 20180613091059,22
[x.x.x.x] < 20180709173731,23
[x.x.x.x] < 20180727131525,24
[x.x.x.x] < 20180731110728,25
[x.x.x.x] < 20180808144940,26
[x.x.x.x] < 20180912111050,27
[x.x.x.x] < 20180912111504,28
[x.x.x.x] > cd /var/www/vhosts/x && (if [ -d /var/www/vhosts/x/releases/29 ]; then echo 'true'; fi)
[x.x.x.x] > cd /var/www/vhosts/x && (date +"%Y%m%d%H%M%S")
[x.x.x.x] < 20180912111821
[x.x.x.x] > cd /var/www/vhosts/x && (echo '20180912111821,29' >> .dep/releases)
[x.x.x.x] > cd /var/www/vhosts/x && (mkdir /var/www/vhosts/x/releases/29)
[x.x.x.x] > cd /var/www/vhosts/x && (if [[ $(man ln 2>&1 || ln -h 2>&1 || ln --help 2>&1) =~ '--relative' ]]; then echo 'true'; fi)
[x.x.x.x] < true
[x.x.x.x] > cd /var/www/vhosts/x && (ln -nfs --relative /var/www/vhosts/x/releases/29 /var/www/vhosts/x/release)
• done on [x.x.x.x]
✔ Ok [1s 677ms]
➤ Executing task deploy:update_code
[x.x.x.x] > if hash command 2>/dev/null; then echo 'true'; fi
[x.x.x.x] < true
[x.x.x.x] > command -v 'git'
[x.x.x.x] < /usr/bin/git
[x.x.x.x] > /usr/bin/git version
[x.x.x.x] < git version 1.8.3.1
[x.x.x.x] > cd /var/www/vhosts/x && (if [ -h /var/www/vhosts/x/release ]; then echo 'true'; fi)
[x.x.x.x] < true
[x.x.x.x] > cd /var/www/vhosts/x && (readlink /var/www/vhosts/x/release)
[x.x.x.x] < releases/29
[x.x.x.x] > cd /var/www/vhosts/x && (/usr/bin/git clone -b master --depth 1 --recursive -q git@bitbucket.org:x/x.git /var/www/vhosts/x/releases/29 2>&1)
Warning: Permanently added the RSA host key for IP address '18.205.93.2' to the list of known hosts.
Connection to x.x.x.x closed.
• done on [x.x.x.x]
✔ Ok [3s 911ms]
➤ Executing task enable_prod_config
[x.x.x.x] > cp "/var/www/vhosts/x/releases/29/.env.prod" "/var/www/vhosts/x/releases/29/.env"
• done on [x.x.x.x]
✔ Ok [143ms]
➤ Executing task deploy:shared
[x.x.x.x] > if [ -d /var/www/vhosts/x/shared/web/app/cache ]; then echo 'true'; fi
[x.x.x.x] < true
[x.x.x.x] > rm -rf /var/www/vhosts/x/releases/29/web/app/cache
[x.x.x.x] > mkdir -p `dirname /var/www/vhosts/x/releases/29/web/app/cache`
[x.x.x.x] > ln -nfs --relative /var/www/vhosts/x/shared/web/app/cache /var/www/vhosts/x/releases/29/web/app/cache
[x.x.x.x] > if [ -d /var/www/vhosts/x/shared/web/app/upgrade ]; then echo 'true'; fi
[x.x.x.x] < true
[x.x.x.x] > rm -rf /var/www/vhosts/x/releases/29/web/app/upgrade
[x.x.x.x] > mkdir -p `dirname /var/www/vhosts/x/releases/29/web/app/upgrade`
[x.x.x.x] > ln -nfs --relative /var/www/vhosts/x/shared/web/app/upgrade /var/www/vhosts/x/releases/29/web/app/upgrade
[x.x.x.x] > if [ -d /var/www/vhosts/x/shared/web/app/uploads ]; then echo 'true'; fi
[x.x.x.x] < true
[x.x.x.x] > rm -rf /var/www/vhosts/x/releases/29/web/app/uploads
[x.x.x.x] > mkdir -p `dirname /var/www/vhosts/x/releases/29/web/app/uploads`
[x.x.x.x] > ln -nfs --relative /var/www/vhosts/x/shared/web/app/uploads /var/www/vhosts/x/releases/29/web/app/uploads
[x.x.x.x] > if [ -d /var/www/vhosts/x/shared/web/app/w3tc-config ]; then echo 'true'; fi
[x.x.x.x] < true
[x.x.x.x] > rm -rf /var/www/vhosts/x/releases/29/web/app/w3tc-config
[x.x.x.x] > mkdir -p `dirname /var/www/vhosts/x/releases/29/web/app/w3tc-config`
[x.x.x.x] > ln -nfs --relative /var/www/vhosts/x/shared/web/app/w3tc-config /var/www/vhosts/x/releases/29/web/app/w3tc-config
[x.x.x.x] > if [ -d /var/www/vhosts/x/shared/web/app/wfcache ]; then echo 'true'; fi
[x.x.x.x] < true
[x.x.x.x] > rm -rf /var/www/vhosts/x/releases/29/web/app/wfcache
[x.x.x.x] > mkdir -p `dirname /var/www/vhosts/x/releases/29/web/app/wfcache`
[x.x.x.x] > ln -nfs --relative /var/www/vhosts/x/shared/web/app/wfcache /var/www/vhosts/x/releases/29/web/app/wfcache
[x.x.x.x] > if [ -d /var/www/vhosts/x/shared/web/app/wflogs ]; then echo 'true'; fi
[x.x.x.x] < true
[x.x.x.x] > rm -rf /var/www/vhosts/x/releases/29/web/app/wflogs
[x.x.x.x] > mkdir -p `dirname /var/www/vhosts/x/releases/29/web/app/wflogs`
[x.x.x.x] > ln -nfs --relative /var/www/vhosts/x/shared/web/app/wflogs /var/www/vhosts/x/releases/29/web/app/wflogs
• done on [x.x.x.x]
✔ Ok [3s 438ms]
➤ Executing task deploy:vendors
[x.x.x.x] > if hash unzip 2>/dev/null; then echo 'true'; fi
[x.x.x.x] < true
[x.x.x.x] > if hash composer 2>/dev/null; then echo 'true'; fi
[x.x.x.x] > if hash command 2>/dev/null; then echo 'true'; fi
[x.x.x.x] < true
[x.x.x.x] > command -v 'php'
[x.x.x.x] < /usr/bin/php
[x.x.x.x] > cd /var/www/vhosts/x/releases/29 && curl -sS https://getcomposer.org/installer | /usr/bin/php
[x.x.x.x] < All settings correct for using Composer
[x.x.x.x] < Downloading...
[x.x.x.x] < Composer (version 1.7.2) successfully installed to: /var/www/vhosts/x/releases/29/composer.phar
[x.x.x.x] < Use it: php composer.phar
[x.x.x.x] > cd /var/www/vhosts/x/releases/29 && /usr/bin/php /var/www/vhosts/x/releases/29/composer.phar install --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader
[x.x.x.x] < Loading composer repositories with package information
[x.x.x.x] < Installing dependencies from lock file
[x.x.x.x] < Dependency resolution completed in 0.001 seconds
[x.x.x.x] < Analyzed 82 packages to resolve dependencies
[x.x.x.x] < Analyzed 103 rules to resolve dependencies
[x.x.x.x] < Package operations: 18 installs, 0 updates, 0 removals
[x.x.x.x] < Installs: johnpbloch/wordpress-core-installer:1.0.0.2, composer/installers:v1.0.25, johnpbloch/wordpress-core:4.9.8, johnpbloch/wordpress:4.9.8, oscarotero/env:v1.1.0, roots/wp-password-bcrypt:1.0.0, vlucas/phpdotenv:v2.5.1, wpackagist-plugin/display-posts-shortcode:2.9.0, wpackagist-plugin/legacy-google-calendar-events:2.4.1, wpackagist-plugin/members:2.1.0, wpackagist-plugin/nice-paypal-button-lite:1.05.1, wpackagist-plugin/sermon-manager-for-wordpress:2.14.0, wpackagist-plugin/uk-cookie-consent:2.3.11, wpackagist-plugin/visual-form-builder:2.9.9, wpackagist-plugin/w3-total-cache:0.9.7, wpackagist-plugin/wordfence:7.1.11, wpackagist-plugin/wordpress-importer:0.6.4, wpackagist-plugin/wordpress-seo:8.2
[x.x.x.x] <   - Installing johnpbloch/wordpress-core-installer (1.0.0.2):
[x.x.x.x] < Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing composer/installers (v1.0.25): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing johnpbloch/wordpress-core (4.9.8):
[x.x.x.x] < Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing johnpbloch/wordpress (4.9.8): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing oscarotero/env (v1.1.0):
[x.x.x.x] < Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing roots/wp-password-bcrypt (1.0.0):
[x.x.x.x] < Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing vlucas/phpdotenv (v2.5.1): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing wpackagist-plugin/display-posts-shortcode (2.9.0):
[x.x.x.x] < Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing wpackagist-plugin/legacy-google-calendar-events (2.4.1):
[x.x.x.x] < Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing wpackagist-plugin/members (2.1.0): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing wpackagist-plugin/nice-paypal-button-lite (1.05.1): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing wpackagist-plugin/sermon-manager-for-wordpress (2.14.0): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing wpackagist-plugin/uk-cookie-consent (2.3.11): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing wpackagist-plugin/visual-form-builder (2.9.9): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing wpackagist-plugin/w3-total-cache (0.9.7): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing wpackagist-plugin/wordfence (7.1.11): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing wpackagist-plugin/wordpress-importer (0.6.4): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] <   - Installing wpackagist-plugin/wordpress-seo (8.2): Loading from cache
[x.x.x.x] <  Extracting archive
[x.x.x.x] < Generating optimized autoload files
• done on [x.x.x.x]
✔ Ok [3s 672ms]
➤ Executing task deploy:symlink
[x.x.x.x] > if [[ $(man mv 2>&1 || mv -h 2>&1 || mv --help 2>&1) =~ '--no-target-directory' ]]; then echo 'true'; fi
[x.x.x.x] < true
[x.x.x.x] > mv -T /var/www/vhosts/x/release /var/www/vhosts/x/current
• done on [x.x.x.x]
✔ Ok [334ms]
➤ Executing task cachetool:clear:opcache
➤ Executing task deploy:failed
• done on [x.x.x.x]
✔ Ok [1ms]
➤ Executing task deploy:unlock
[x.x.x.x] > rm -f /var/www/vhosts/x/.dep/deploy.lock
• done on [x.x.x.x]
✔ Ok [143ms]

In Configuration.php line 93:

  [Deployer\Exception\ConfigurationException]
  Configuration parameter `cachetool_args` does not exist.

Exception trace:
 Deployer\Configuration\Configuration->get() at phar:///usr/local/bin/dep/src/functions.php:537
 Deployer\get() at /mnt/d/web/x/vendor/deployer/recipes/recipe/cachetool.php:44
 Deployer\Deployer::Deployer\{closure}() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/dep/src/Task/Task.php:105
 Deployer\Task\Task->run() at phar:///usr/local/bin/dep/src/Executor/SeriesExecutor.php:63
 Deployer\Executor\SeriesExecutor->run() at phar:///usr/local/bin/dep/src/Console/TaskCommand.php:142
 Deployer\Console\TaskCommand->execute() at phar:///usr/local/bin/dep/vendor/symfony/console/Command/Command.php:252
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/dep/vendor/symfony/console/Application.php:946
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/dep/src/Console/Application.php:133
 Deployer\Console\Application->doRunCommand() at phar:///usr/local/bin/dep/vendor/symfony/console/Application.php:248
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/dep/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/dep/src/Deployer.php:331
 Deployer\Deployer::run() at phar:///usr/local/bin/dep/bin/dep:119
 require() at /usr/local/bin/dep:4

deploy [-p|--parallel] [-l|--limit LIMIT] [--no-hooks] [--log LOG] [--roles ROLES] [--hosts HOSTS] [-o|--option OPTION] [--] [<stage>]
antonmedv commented 6 years ago

A bug. I think blame https://github.com/deployphp/recipes/pull/190 ping @trsteel88

trsteel88 commented 6 years ago

Sorry about that. Submitted a pr to resolve.

antonmedv commented 6 years ago

Should be fixed

antonmedv commented 6 years ago

Done.