Deployer: Detecting vendor/bin/dep

Created on 12 Oct 2020  路  5Comments  路  Source: deployphp/deployer

Currently Deployer can detect autoload.php file:
https://github.com/deployphp/deployer/blob/master/bin/dep#L63-L67

We need to be able also to detect vendor/bin/dep files and execute them instead.

Who wants to implement it?

feature

Most helpful comment

Sure! Here is the deal:

  • Deployer can be installed globally to have simple access to dep command, be able to run dep init in my project, etc.
  • Project may have Deployer as a dependency with another version.
  • We want in the project dir run global dep command, which should start local dep command if it is available.

Let's imagine we have Deployer globally installed, now some project may have Deployer installed in the next ways:

  • Via composer require deployer/deployer

    • So we have Deployer files in the _vendor_ directory.

    • Currently dep correctly detects this and uses local Deployer instead of global.

      This is done by this part of code: bin/dep#L70-L92.

  • Via composer require deployer/distribution

    • Phar archive will be downloaded and located in vendor/bin/dep.

    • Not supported at this point. <-- The issue about this part.

  • Via downloading phar from site and placing in repo root as bin/dep or deployer.org.

    • Not supported at this point. <-- The issue about this part.

How to implement this feature:

  • First, create tests for all cases (even older phar archives may be downloaded and committed to repo tests).
  • Try to implement redirect of call for 2, 3 cases.

    • If during implementation some _eureka!_ moments appeared, or a better solution found, feel free to refactor everything related.

Feel free to ask any questions before and during implementation.

All 5 comments

@antonmedv i am interested in implementing this feature but i would like to know little more about this feature.

Sure! Here is the deal:

  • Deployer can be installed globally to have simple access to dep command, be able to run dep init in my project, etc.
  • Project may have Deployer as a dependency with another version.
  • We want in the project dir run global dep command, which should start local dep command if it is available.

Let's imagine we have Deployer globally installed, now some project may have Deployer installed in the next ways:

  • Via composer require deployer/deployer

    • So we have Deployer files in the _vendor_ directory.

    • Currently dep correctly detects this and uses local Deployer instead of global.

      This is done by this part of code: bin/dep#L70-L92.

  • Via composer require deployer/distribution

    • Phar archive will be downloaded and located in vendor/bin/dep.

    • Not supported at this point. <-- The issue about this part.

  • Via downloading phar from site and placing in repo root as bin/dep or deployer.org.

    • Not supported at this point. <-- The issue about this part.

How to implement this feature:

  • First, create tests for all cases (even older phar archives may be downloaded and committed to repo tests).
  • Try to implement redirect of call for 2, 3 cases.

    • If during implementation some _eureka!_ moments appeared, or a better solution found, feel free to refactor everything related.

Feel free to ask any questions before and during implementation.

@antonmedv thanks for the explanation in detail,

  • Via composer require deployer/deployer
 This is related with this repository right https://github.com/deployphp/distribution

Yes distribution phar is there.

Looking for a contributor!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JonasDoebertin picture JonasDoebertin  路  4Comments

krve picture krve  路  4Comments

khoanguyen96 picture khoanguyen96  路  5Comments

lsv picture lsv  路  4Comments

antonmedv picture antonmedv  路  5Comments