TheDMSGroup / mautic-eb

Mautic + Elastic Beanstalk = Scalable marketing automation
https://www.mautic.org
GNU General Public License v3.0
105 stars 27 forks source link

How to install 3rd Party Plugin #90

Closed zero-one-devteam closed 5 years ago

zero-one-devteam commented 5 years ago

What type of report is this:

Q A
Bug report?
Feature request?
Enhancement?
Question? yes

Description:

I like to install this plugin: https://github.com/Logicify/mautic-advanced-templates-bundle I tried with: git submodule add https://github.com/Logicify/mautic-advanced-templates-bundle.git plugins/mautic-advanced-templates-bundle

I removed the folder "plugins" from .gitignore.

After deployment, the plugin exists in the appropriate folder. But when clicking on "Install Plugin" it does not appear.

Any better way to install this plugin?

If a bug:

Q A
Mautic version 2.15.0
PHP version 7.2

Steps to reproduce:

  1. comment out /plugins in .gitignore
  2. run "git submodule add https://github.com/Logicify/mautic-advanced-templates-bundle.git plugins/mautic-advanced-templates-bundle" from mautic-eb folder
  3. deploy, check, if folder is in mautic/plugins (symlink is OK)
  4. Go to settings->plugins->Install Plugin
  5. no plugin will be installed

Log errors:

heathdutton commented 5 years ago

Why not just use Composer? It's literally designed for this, and there is a standard installer for Mautic plugins.

To make this easier, we have an automatic inclusion for any file in the root named composer.custom. You can include mautic plugins in your builds by creating a composer.custom file and treat it like a standard composer.json. During composer install you'll end up with modifications to composer.lock that include the 3rd party plugin and all it's dependencies (if any). Upgrades will be easier as you'll just have to maintain that composer.custom file for your third-party stuff.

Look at composer.custom.dev as an example. This is how we install all of our desired plugins and things. For example, if you were to rename that to just composer.custom then during your build (composer install step of build.sh) the cusomtizations we use at our company would be bundled in with your build.

If the plugin isn't packaged (isn't registered in packagist, like the one you mentioned), you can still use composer.custom to include it, just do so with an accompanying repository entry. Requires a few more lines, and you'll need to make sure the Bundle name is exactly right, but it will still work.

zero-one-devteam commented 5 years ago

Ok, understood. I've already looked into the composer.json and the included composer.custom. I can install it with composer as well - would be the better way.

But the problem would be the same. Currently the plugin is already in the mautic/plugin directory (as symlink to the /plugin directory). But Mautic does not find it when clicking on "Install/Upgrade Plugins". As I have installed the same plugin on a "standalone" Mautic version, I assumed that I've missed anything special here ...

zero-one-devteam commented 5 years ago

Hmm, after rebuilding the environment, it works now. Also, I am using composer.custom now which works pretty good ;-) Thanks for your help.