Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Problem resolving CacheTool binary #238

Closed
alexsegura opened this issue Sep 10, 2019 · 0 comments
Closed

Problem resolving CacheTool binary #238

alexsegura opened this issue Sep 10, 2019 · 0 comments

Comments

@alexsegura
Copy link

Q A
Issue Type Bug
Deployer Version 6.5.0
Recipes Version dev-master
Local Machine OS Mac OSX
Remote Machine OS Debian Jessie

Description

I'm trying to use the cachetool recipe, but it fails.
Actually, the command in locateBinaryPath fails and returns 1 (I don't have cachetool.phar, the recipe should download it)
It tried running command, which & type manually, but all of them return 1.
It looks like cachetool.phar is not really "executable", so it fails (actually, we have to do php cachetool.phar to execute CacheTool). locateBinaryPath doesn't work for cachetool.phar

Steps to reproduce

Content of deploy.php

require 'recipe/cachetool.php';
// ...
set('cachetool', '127.0.0.1:9000');
// ...
after('deploy:symlink', 'cachetool:clear:opcache');

Output log

In Client.php line 103:

  The command "export SYMFONY_ENV='prod'; command -v 'cachetool.phar' || which 'cachetool.phar' || type -p 'cachetool
  .phar'" failed.

  Exit Code: 1 (General error)

I fixed it like this, by testing the existence of the file

set('bin/cachetool', function () {
    if (!test('[ -f {{release_path}}/{{cachetool_binary}} ]')) {
        run('cd {{release_path}} && curl -sSO https://gordalina.github.io/cachetool/downloads/{{cachetool_binary}}');
    }

    return '{{release_path}}/{{cachetool_binary}}';
});

Should I submit a pull request?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants