Open photodude opened 8 years ago
The only example you're going to find that's any good right now would probably be how the test team set up the weblinks repo to run acceptance tests. And unfortunately that involves a lot of overhead and assumed configurations.
Joomla in general is hesitant to embrace command line sadly. Efforts to create command line structure (I know there've been proposals for a CLI update system and my attempt at a standardized CLI interface for components to build on) stalled out every time they were presented.
And what about something that would act like
$input = JFactory::getApplication()->input;
$input->set('installtype','url');
$input->set('install_url','http://repo.dev/package.zip');
JLoader::register('InstallerModelInstall',JPATH_ADMINISTRATOR.'/components/com_installer/models/install.php');
$installer = new InstallerModelInstall();
$installer->install();
I don't know if provided code can be used for CLI in any meaning, but if we could put in $http_url_to_your_package
from command line I guess it will almost work.
Still this is not JApplicationCLI, but it might be workaround for this issue and may be ground for building on thoughts.
I've just tested provided implementation and added changes needed to make it work. Also 1 remark - as you can see supplied url must give back zip.
@photodude share if you'll accomplish this. I believe point 1 is the easiest one, but still haven't tried it. Hope will do in nearest future.
@alex7r in the workflow listed above you can already install Joomla with Git (I think you can also use composer or the Joomla docker). It's the cli install of an extension in the example workflow that is the issue, it's complicated or impossible at the moment.
@photodude I provided code example above that should almost do what you need. It just need to be tested and maybe fixed a little bit. It's the simpliest way to go. Also if you interested in another work around I could share another process with docker/vagrant with LAMP + Codeception + PhantomJS.
@alex7r I'll have to see about trying that. I would be interested in your other solution as well.
My intention is for a single command line action (CLI) where you would just do something like the following.
jacs install '/path/to/extension.zip'
@photodude I'll try to create working code and maybe even try to add it as CLI file to joomla repository - if I'll do this I'll submit link here for you to that PR. And mainly this provided code is near what you want.
I finished the script and will upload it today in a couple of hours I believe.
Here we go: https://github.com/joomla/joomla-cms/pull/14999
And I'll add up here link to "PhantomJS way" little bit latter.
Would be beneficial to have a command line method and documentation for installing Joomla! extensions for testing via Travis-CI
example workflow,
(note: I tried once following a very good 2014 explanation on CLI install of extensions. but was unable to successfully make it work for Travis-CI)
see also