2

With the INI-style drush .make files I could say includes[common] = "common.make" in say, drupal_master.make but I can't see a way of breaking my make.yml files into smaller reusable chunks.
I've tried

imports:
  - common.make.yml

(like Symfony uses elsewhere) as well as other guesses and I can't see any examples or documentation on "including" YAML drush make sub-files.

Can it be done?

1
  • Thanks to @burnsjeremy for correct answer. I recently also discovered the docs here
    – iainH
    Oct 18, 2015 at 23:00

3 Answers 3

2

Edit: I do see that you were using the wrong keyword, it should be includes and not imports.

It looks like you have the correct syntax above I believe. We use something like the code below in our make process, there are three different core makes that we call that one in, local, development, and build (we wanted to get updated versions in local and more stable ones in dev and build, just so we can update when appropriate.). It works pretty well but see the code below for an example. Thanks!

api: 2
core: X.x

defaults:
  projects:
    subdir: "contrib"

includes:
  - drupal.make.yml
  - libraries.make.yml
  - modules.make.yml
  - themes.make.yml
  - custom.make.yml

Here is the link for the Drush documentation for the make files, I didn't notice that they had swapped over to YML in the make docs or I would have started with this probably: Drush Docs - Make.

2
  • Just to expand upon @burnsjeremy's answer now that I have it working: both the including and an included file can contain a projects: key. Please see my additional answer.
    – iainH
    Oct 18, 2015 at 22:12
  • Just like to add that you can include a fully qualified URL: https://server.com/path-to-make.yml
    – uotonyh
    Jun 14, 2017 at 19:07
0

A typical "including" make.yml file:

---
# dev.make.yml
api: 2
core: "8.x"

includes:
  - common.make.yml

projects:
  # Modules only for development.
  devel: "1.x-dev"   

and an "included" file:

---
# common.make.yml
projects:

  drupal:
    type: "core"
    download:
      branch: "8.0.0-rc1"
      working-copy: true

  views_slideshow: 3.0-beta1
1
  • Actually documented here now that I know what I'm looking for.
    – iainH
    Oct 18, 2015 at 22:58
-1

Drush do a large use of YAML files, I suggest you organize as a codebase and use a command line tool to parse a group of files into one for every task! You can include the common parts and share schemas use a '$include' tag provided by utility like this https://github.com/javanile/yamlinc

Comparisone 'includes:' vs '$include:'

'includes:' only support specific section no nested include support, only one level of inclusion '$include:' generic place everywhere you need it, nested inclusions supported

1
  • I don't think this is really an answer that contributes anything more that the accepted answer of more than two years
    – iainH
    Mar 1, 2018 at 10:12

Your Answer

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

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