Closed ghost closed 6 years ago
Thanks @BWPanda can you provide an example of the makefile
or maybe even a simplified version of it as a target use case for this functionality?
It is definitely possible to get this going.
I've added a PR: https://github.com/backdrop-contrib/drush/pull/132
That constructs a bmake
command from the ground up (rather than porting the existing drush make
command). I did it that way because:
drush make
command is huge and does a lot of things; I would not be able to comprehend and port them in a few hours.This the current functionality is limited to getting Backdrop, modules, themes, and layouts that are specified in a myfile.make.yml
file. (this depends on having the PHP yaml extension in order to parse the file). I've added a README.md for the drush bmake
command.
@BWPanda if you are up for testing that would be great! There is not too much harm on merging now and iterating on features/bugs as currently we have no make
functionality.
I'll look into this tomorrow possibly, but I can say now that if there's any possibility of not having a dependency on yaml, that'd be great.
I have no idea what yaml is, only that I've heard of it in conjunction with D8 as one of the many new technologies I'd have to become familiar with in order to use it (and one of the reasons I didn't go down the D8 path).
If it needs to stay, I'll be ok with that, but since Drush 8 still supports the legacy info file format, I'd suggest using that instead. yaml isn't used anywhere else in Backdrop (that I'm aware of), but info files abound, so I can see that fitting in with Backdrop better...
@BWPanda I didn't know about the info file format for make
i just saw the yaml
they currently use; I'm sure I can refactor to use the .info
format.
I'll look into it
I've updated the PR to use the PHP ini format:
; Drush bmake ini file
; Backdrop Core Version
core = "1.x"
; Add a list of modules for your project.
[modules]
webform = "1.x-4.16.0"
headless = "1.x-1.0.0"
; Add a list of themes for your project.
[themes]
bootstrap_lite = 3
purple = 8
; Add a list of layouts for your project.
[layouts]
hero = 1
As of now the version numbers have no effect; I still need to refactor dl
to accept a --version
option and allow users to pin versions for there builds.
I've updated the PR to give dl
a --version
option which a user can pass in a specific version of a module, theme, or layout:
drush dl webform --version=1.x-1.6.2
In turn the drush bmake
command can now pass the version
strings from the make.ini
file into the new --version
option. So if you have a makefile called myfile.make.ini
the command:
drush bmake myfile.make.ini my-app
will download backdrop, prompt for interactive install (DB creds etc.
or you can pass in the D6 style db-url for a non-interactive run.
drush bmake myfile.make.ini my-app --db-url=mysql://MYSQLUSER:MYSQLPASS@localhost/MYAPPDB
per gitter; refactor to drush bake
and examine aliases.
Thanks @serundeputy! Let me know if/when you want me to test your work. In the meantime, here's a list of things I'd love to be able to do with a make file (not sure if you've already accounted for these things or not):
Thanks @BWPanda This is a great list and will help me focus development!
Support Backdrop multisites (e.g. download modules (and themes, etc.) into /sites/[SITE_NAME]/modules/ and not need to download Backdrop core each time)
drush bmake
does not currently do this; I'd like to open a new feature request issue for this one. We can make it happen
destination
or a path
option to the drush dl
command that we can then have drush bmake
hand off to the new option[core]
section to tell bmake
to not download backdrop. maybe something like:[core]
core = "false"
Download latest, stable versions of modules, themes, etc. without needing to specify a version number (should match the 'core' Backdrop version)
headless = "latest"
Download specific versions of modules, themes, etc. (like '1.x-1.0.1', or better yet '1.0.1' (it should get the '1.x' from the 'core' value))
headless = "1.x-1.0.0"
Some modules in backdrop-contrib use the 1.x
preface to indicate which core they support ( not all, but most?) ... I have no good way of knowing which ones do and don't, but I think I've put some handling of that in drush up
... I can check it out and see if I can make drush bmake
work with or without the 1.x
preface in the module, theme, and layout version strings. I think I'd like to see that as a new issue/feature as to not hold up what we have so far.
Download non-Backdrop projects (like other GitHub repositories, specify a custom URL, etc.)
We should open a new issue for this feature as well. Some kind of general git pull
functionality or something; having a specific use case would help drive development of this feature a great deal.
Download a specific branch (Backdrop equivalent of applying a Drupal patch) (e.g. '1.x-1.x')
This would be great as well! I've got an issue about allowing drush dl
to get dev
versions here: https://github.com/backdrop-contrib/drush/issues/107. Once drush dl
adds the functionality to handle the --dev
flag we can then have drush bmake
pass off to that just like in the --version
case.
thanks for the great list. Feel like opening a couple of issues?
Thanks! I've added issues as above. I didn't bother creating an issue for leaving out the BD core version (1.x
) as I can see how that's probably not even possible with the way Backdrop/GitHub is setup. So never mind about that.
@BWPanda Great! I've merged the PR as is so we can iterate on the new issues.
That means feel free to update your drush and test and use the current bmake
and I'll start on the other issues.
I'm trying to write a custom install profile which includes a make file to download specific modules automatically. Running
drush make
displaysThis command is not supported yet by Backdrop.
...Can we add support for drush make to Backdrop?
PR: https://github.com/backdrop-contrib/drush/pull/132