12

I am trying to use modman (https://github.com/colinmollenhour/modman) for managing my Extensions in github.

First I am trying to add MagePsycho_Someext extension as demo.

So far I have done the following steps

/var/www/magento-dir/ -> My Magento Installation Dir
/var/www/MagePsycho_Extensions/ --> Git Repository Dir
  1. cd /var/www/MagePsycho_Extensions/
  2. git clone [email protected]:magepsycho/Someext.git
  3. touch modman
  4. git commit -am 'Modman file added'
  5. git push origin master
  6. cd /var/www/magento-dir/
  7. modman init
  8. modman clone [email protected]:magepsycho/Someext.git
  9. Developed the extension 'MagePsycho_Someext' in /var/www/magento-dir with the following files
    • app/etc/modules/MagePsycho_Someext.xml
    • app/code/local/MagePsycho/Someext/etc/config.xml
    • app/code/local/MagePsycho/Someext/Helper/Data.php

10 Added the files mapping info in /var/www/magento-dir/.modman/Someext/modman as

app/etc/modules/MagePsycho_Someext.xml  app/etc/modules/MagePsycho_Someext.xml
app/code/local/MagePsycho/Someext/etc/config.xml app/code/local/MagePsycho/Someext/etc/config.xml
app/code/local/MagePsycho/Someext/Helper/Data.php app/code/local/MagePsycho/Someext/Helper/Data.php

11 modman update Someext

but got the following errors:

WARNING: Target does not exist (.modman/Someext/modman):
 app/etc/modules/MagePsycho_Someext.xml  app/etc/modules/MagePsycho_Someext.xml

Notes: I am developing extensions in /var/www/magento-dir/. And want to deploy these extensions(one per repository) in github using modman. When I am finished with module development, I want those files to be added to the repository. For that I have used .modman/*/modman file for mapping. But unable to make it work.

Where and what am I missing?
Or Is this the incorrect approach?

[EDIT]

I just realised that my approach is just opposite. First, You have to add extension files and modman with path mappings, push it to the repo and then pull it using modman clone.

How would you do if you first develop the extension and then use modman for pushing changes to the repo?

7
  • 1
    Can't give a comprehensive reply at the moment but generally you shouldn't be modifying stuff in .modman folder. This is a good starting point github.com/colinmollenhour/modman/wiki/Tutorial
    – Zifius
    Jul 27, 2014 at 21:42
  • I am not sure where to manage the mappings. in /var/www/MagePsycho_Extensions/Someext/modman? If yes then have to push the changes to github and pull it using modman update?
    – MagePsycho
    Jul 27, 2014 at 21:50
  • I don't understand why you are referencing the extension directly, if is in a repo you can download it directly from there. Jul 27, 2014 at 21:51
  • Inside your extension root repo there should be a modman file with the mappings defined. Jul 27, 2014 at 21:52
  • Wait are you trying to pull the extension from /var/www/magento-dir/ into a separate repo ? Jul 27, 2014 at 21:53

2 Answers 2

7

Finally I figured out the way to manage Magento modules using modman(not the perfect way though but it works for me)

Assumptions

/var/www/magento-dir/ -> My Magento Installation Dir
/var/www/MagePsycho_Extensions/ --> Git Repo Dir
  1. cd /var/www/MagePsycho_Extensions/
  2. git clone [email protected]:magepsycho/Someext.git
  3. touch modman
  4. git commit -am 'Modman file added'
  5. git push origin master
  6. cd /var/www/magento-dir/
  7. modman init
  8. modman link /var/www/MagePsycho_Extensions/Someext
  9. Now develop the extension 'MagePsycho_Someext' in /var/www/magento-dir/.modman/Someext with the following files
    • app/etc/modules/MagePsycho_Someext.xml
    • app/code/local/MagePsycho/Someext/etc/config.xml
    • app/code/local/MagePsycho/Someext/Helper/Data.php

10 Add the files mapping info in /var/www/magento-dir/.modman/Someext/modman as

app/etc/modules/MagePsycho_Someext.xml  app/etc/modules/MagePsycho_Someext.xml
app/code/local/MagePsycho/Someext/etc/config.xml app/code/local/MagePsycho/Someext/etc/config.xml
app/code/local/MagePsycho/Someext/Helper/Data.php app/code/local/MagePsycho/Someext/Helper/Data.php

11 modman repair
12 cd /var/www/magento-dir/.modman/Someext
13 git add app/etc/modules/MagePsycho_Someext.xml app/code/local/MagePsycho/Someext/etc/config.xml app/code/local/MagePsycho/Someext/Helper/Data.php
14 git commit -m 'Extension files updated.'
15 git push origin master
16 That's all.

In summary, you will be working on magento-dir/.modman/Someext directory which is symlinked to magento-dir. Whenever you add new files to your extension you have to update the modman file and run modman repair which keeps the symlinks up-to date.

If anyone has better approach, please do share.

0
6

So my advice here is since you have a local copy of the extension anyway then use the link and deploy commands rather than the clone

In your case you would simply call:

  1. modman init
  2. modman link ../Your_Extension_Path (if this is a single extension)
  3. modman deploy Your_Extension_Path

This method needs you to have the modman file complete in your extension directory with file mappings but from your comments it appears you already have this.

From my understanding the files need to be in the extension dir first, they will then by linked into the magento dir so then when you make future edits to the files under magento the extension files are also changed. Maybe there is a way of creating a modman extension from a magento directory but sadly I do not know it.

A simple way of coping files from Magento to an extension dir is either having two windows explorers open for windows and copy them across or use something like midnight commander

Note: I have only used the modman for php version but this process works for that

7
  • /var/www/MagePsycho_Extensions/ will be have more extensions say: Extension1, Extension2 with different repositories. Will that make a difference using your approach?
    – MagePsycho
    Jul 28, 2014 at 7:47
  • not sure but I guess you would just need two levels to link like ../MagePsycho_extenstion/Extension1 and then deploy would either be MagePsycho_extenstion/Extension1 or Extension1 I am not sure without trying it out. Jul 28, 2014 at 7:49
  • After following your link & deploy approach, gives the same error WARNING: Target does not exist (.modman/MagePsycho_Someext/modman): app/etc/modules/MagePsycho_Someext.xml app/etc/modules/MagePsycho_Someext.xml
    – MagePsycho
    Jul 28, 2014 at 8:09
  • @MagePsycho and you actually have this file in your extension? Jul 28, 2014 at 8:18
  • 2
    From my understanding the files need to be in the extension dir first, they will then by linked into the magento dir so then when you make future edits to the files under magento the extension files are also changed. Maybe there is a way of creating a modman extension from a magento directory but sadly I do not know it. Jul 28, 2014 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.