Build a “Contributed” or “DKAN” Module in a Client Project¶
Workflow¶
The best workflow for this is to:
- Add the module
- Add the module as if it was just another “contributed” module: Add a contributed module
- Once this is done a link to the module should exist in
custom.make
.
- Delete the module
- Delete the module in
docroot/sites/all/modules/contrib
- Delete the module in
- Clone the module
- Clone the module from the upstream repo into
docroot/sites/all/modules/contrib
.
- Clone the module from the upstream repo into
- Commit local changes to the contributed module
- DO NOT commit local changes to the client repo
- Push to the client repo
- update the link to
custom.make
- When you are ready to reflect that local changes in the client repo update the reference in custom.make
- run
ahoy build custom
1. Changes should then appear in the module indocroot/sites/all/modules/contrib
- update the link to
Example¶
Lets say you are working on a module which adds hover-bear functionality to a client project and the module lives at http://github.com/GetDKAN/dkan_hover_bears.
Add the module
- The custom.make file should include:
projects[dkan_dkan_hover_bears][type] = module projects[dkan_dkan_hover_bears][download][type] = git projects[dkan_dkan_hover_bears][download][url] = https://github.com/GetDKAN/dkan_dkan_hover_bears.git projects[dkan_dkan_hover_bears][download][revision] = 0c57133a4fb8c26cd03ee7607ebd7f983b853b8c
- Note the revision. You can include branch during development but it is safer to use a commit. Using the a branch look like:
projects[dkan_dkan_hover_bears][type] = module projects[dkan_dkan_hover_bears][download][type] = git projects[dkan_dkan_hover_bears][download][url] = https://github.com/GetDKAN/dkan_dkan_hover_bears.git projects[dkan_dkan_hover_bears][download][branch] = civic-12311-hover-bear-stare
Delete the module
rm -r docroot/sites/all/modules/contrib/dkan_hover_bears
- Clone the module
git clone git@github.com:GetDKAN/dkan_hover_bears.git
- Commit local changes
- cd into
docroot/sites/all/modules/contrib/dkan_hover_bears
- commit changes
- cd into
- Push to the client repo
- MAKE SURE YOU HAVE COMMITTED TO THE MODULE
- Update
custom.make
if you are pointing to a commit. If you are pointing to a branch you shouldn’t need to worry about this as your code has already been pushed to the branch - run
ahoy build custom
- You should see changes in
docroot/sites/all/modules/contrib/dkan_hover_bears
- You should see changes in
- Commit changes to
custom.make
(if you are using revision) anddocroot/sites/all/modules/contrib/dkan_hover_bears