Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Allowing custom modules to be added while in local dev environment #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ivangrynenko
Copy link

While working on GovCMS 8 in my local, I need some custom modules - primarily for development reasons.
For example, devel and devel_generate help me to work on features requiring some content, I can generate content, terms, users easily.
At the moment GovCMS8 has no way of adding those modules.

This PR introduces a directory /modules/ along with a docker-compose mountable volume. Any module that I place into /modules/ directory locally available for my development.

This PR should be considered from the point of Lagoon deployment and is likely requires a custom task of removing either the /modules/* directories from the build artifact or altering the docker-compose.yml, removing the volume definition.

@simesy
Copy link
Contributor

simesy commented Mar 21, 2019

This would be great. Personally I'm putting modules at ./sites/default/modules/local with

      - ./modules-local:/app/web/sites/default/modules/local:${VOLUME_FLAGS:-delegated}

I think the location should be such that a module can override a contrib module. For example, we have been doing bug-fixes on field_group module, and we need to have a custom version that overrides the one in govcms. The order-of-discovery is described here, and please note that there is no reliable order of precendence between custom and contrib, hence my preference for sites/default/modules (thanks for the tip Toby B)

@tobybellwood
Copy link

If you're in local dev, you can set these volumes in docker-compose.override.yml thus:

version: '2.3'

services:
  cli:
    volumes:
      - ./custom/modules:/app/web/modules/local:${VOLUME_FLAGS:-delegated}

  test:
    volumes:
      - ./custom/modules:/app/web/modules/local:${VOLUME_FLAGS:-delegated}
  
  nginx:
    volumes:
      - ./custom/modules:/app/web/modules/local:${VOLUME_FLAGS:-delegated}

  php:
    volumes:
      - ./custom/modules:/app/web/modules/local:${VOLUME_FLAGS:-delegated}

@simesy
Copy link
Contributor

simesy commented Mar 21, 2019

Oh, well that pretty much solves it. Except I notice my gitignore doesn't include docker-compose.override.yml - so do we need that added to gitignore? Or can I commit and push docker-compose.override.yml

@tobybellwood
Copy link

you can commit the docker-compose.override if you want some permanency - it'll not run in Lagoon, just locally

@simesy
Copy link
Contributor

simesy commented Dec 4, 2019

But it will run in Gitlab.... so i think you can't commit it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants