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
cd /var/www/MagePsycho_Extensions/git clone [email protected]:magepsycho/Someext.gittouch modmangit commit -am 'Modman file added'git push origin mastercd /var/www/magento-dir/modman initmodman clone [email protected]:magepsycho/Someext.git- 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?
-
1Can'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/TutorialZifius– Zifius2014年07月27日 21:42:34 +00:00Commented 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– MagePsycho2014年07月27日 21:50:42 +00:00Commented 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.Allan MacGregor– Allan MacGregor2014年07月27日 21:51:15 +00:00Commented Jul 27, 2014 at 21:51
-
Inside your extension root repo there should be a modman file with the mappings defined.Allan MacGregor– Allan MacGregor2014年07月27日 21:52:22 +00:00Commented Jul 27, 2014 at 21:52
-
Wait are you trying to pull the extension from /var/www/magento-dir/ into a separate repo ?Allan MacGregor– Allan MacGregor2014年07月27日 21:53:30 +00:00Commented Jul 27, 2014 at 21:53
2 Answers 2
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
cd /var/www/MagePsycho_Extensions/git clone [email protected]:magepsycho/Someext.gittouch modmangit commit -am 'Modman file added'git push origin mastercd /var/www/magento-dir/modman initmodman link /var/www/MagePsycho_Extensions/Someext- 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.
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:
modman initmodman link ../Your_Extension_Path(if this is a single extension)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
-
/var/www/MagePsycho_Extensions/ will be have more extensions say: Extension1, Extension2 with different repositories. Will that make a difference using your approach?MagePsycho– MagePsycho2014年07月28日 07:47:18 +00:00Commented Jul 28, 2014 at 7:47
-
not sure but I guess you would just need two levels to link like
../MagePsycho_extenstion/Extension1and then deploy would either beMagePsycho_extenstion/Extension1orExtension1I am not sure without trying it out.David Manners– David Manners2014年07月28日 07:49:02 +00:00Commented 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.xmlMagePsycho– MagePsycho2014年07月28日 08:09:54 +00:00Commented Jul 28, 2014 at 8:09
-
@MagePsycho and you actually have this file in your extension?David Manners– David Manners2014年07月28日 08:18:31 +00:00Commented Jul 28, 2014 at 8:18
-
2From 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.David Manners– David Manners2014年07月28日 08:38:55 +00:00Commented Jul 28, 2014 at 8:38