Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

support "extends" keyword #65

Closed
fommil opened this issue May 10, 2017 · 3 comments
Closed

support "extends" keyword #65

fommil opened this issue May 10, 2017 · 3 comments

Comments

@fommil
Copy link

fommil commented May 10, 2017

What needs to be done in order to support the extends keyword? We have all our docker compose files under a directory and it would be really messy to explicitly copy/paste everything.

@kurtkopchik
Copy link
Contributor

Hi @fommil, the plugin currently reads the specified docker-compose.yml file into memory, performs some processing on it and then writes out a new version which is ultimately used when the docker-compose instance is started.

To support the extends keyword the readComposeFile code would have to be updated to:

  1. Follow the linked compose files specified in extends
  2. Merge the contents of those files with the base compose file (I imagine there will be a number of complexities to handle in this step which is why support for this keyword has not yet been added)
  3. Return a representation of the merged compose files for processing

That being said, there is a composeFile setting that can be defined on a per-project basis were you can point the project to use an existing compose file at a location and name of your choosing without having to explicitly copy it into the project:
composeFile := // Specify the full path to the Compose File to use to create your test instance. It defaults to docker-compose.yml in your resources folder.

Is this something that can work for your use case?

@fommil
Copy link
Author

fommil commented May 10, 2017

We're using composeFile already but I hit the error saying that extends is not supported (it extends from another file in the same directory).

@kurtkopchik
Copy link
Contributor

To support the extends feature in docker compose files the plugin code would need to be updated to add the functionality outlined above. I hope to implement this myself in the future but PR's are certainly welcome :)

@fommil fommil closed this as completed Aug 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants