extension-command icon indicating copy to clipboard operation
extension-command copied to clipboard

Install From Private Repo

Open XedinUnknown opened this issue 5 years ago • 1 comments

Feature Request

My Scenario

I am working on Plugin A that needs another of our plugins, Plugin B for compatibility testing. I use Docker, so every plugin project lives in an environment of its own, configured to develop, test, build, and run the plugin. Therefore, I need to install plugin B into the Docker environment of plugin A. I install all plugins using WP CLI, because this guarantees that I receive the tested, built plugin versions, with all assets processed as per the specifications of the individual plugins.

The Problem

Both of my plugins are commercial projects, and unfortunately live in private repos. WP CLI allows installation from URL, and usually I can just point it to a release archive on Github. But in this scenario this is not possible, becauase that requires authentication, and my account is on top of everything protected with 2FA.

Composer

Composer allows installation of packages from private repos. One good thing to use for this is Packagist.com. With a simple auth.json document, Composer has access to all the code that I need from private repositories, regardless of 2FA. If I require-dev Plugin B with Composer this way, I can then mount it from vendor/me/plugin-b to /var/www/html/wp-content/plugins/plugin-b, and that works well for plugins where the dist archive is just a minimal version of the codebase. However, many plugins require processing of their assets in order to work, and their actual dist - the archives that are shipped to end users - can be radically different from their source. In this case, Composer is powerless.

XedinUnknown avatar Jan 21 '21 17:01 XedinUnknown

@XedinUnknown I'm not entirely sure what the ask is here. Would you expect wp plugin install to accept something like auth.json and then figure out encrypted retrieval automatically?

schlessera avatar May 30 '22 12:05 schlessera

Heya! Sorry for the inactivity. I appreciate if this isn't something planned. I guess what I meant was that I would like a feature that would allow installation from private packages/repos, but I'm not suggesting any particular way of achieving that at this point.

Thanks for the response, and sorry again!

XedinUnknown avatar Dec 19 '22 14:12 XedinUnknown

@XedinUnknown No worries!

Given there isn't a standard approach for private packages/repos, this probably doesn't make sense to bundle in WP-CLI. It could be an interesting community package, though!

danielbachhuber avatar Dec 19 '22 20:12 danielbachhuber

From what I can see, there is such a standard - SSH. Any repo I've seen in the recent years supports that method. If this is already a transport that you use, then this is just about having it ask for the stuff and/or depend on the machine's configuration. If not - that seems to be what's missing.

XedinUnknown avatar Jan 04 '23 16:01 XedinUnknown

Gentle reminder. How about the SSH approach? Is this something planned?

XedinUnknown avatar Mar 24 '23 12:03 XedinUnknown

@XedinUnknown I don't think it's anything we'll officially support in WP-CLI at this time. wp plugin install is primarily meant to mirror what wp-admin offers. We're using those internals under the hood. I have no idea what happens when you try to pass a SSH path to it.

Could you use scp to bring the plugins to the local filesystem, and then wp plugin install <zip>?

danielbachhuber avatar Mar 24 '23 17:03 danielbachhuber