-
Notifications
You must be signed in to change notification settings - Fork 124
Adding composer script for "cms-install" #60
Conversation
Good idea. Maybe the circle.yml could call this method. Is parameter-passing going to be an issue here? |
Yes, here? https://github.com/pantheon-systems/example-drops-8-composer/blob/master/circle.yml#L69
Maybe, do composer scripts allow for additional params? |
Should work. |
17d9680
to
d0fa350
Compare
Starting to write some tests for the Terminus Build Tools plugin last night, and was thinking about this. I think we should break out several steps of the process as Composer scripts:
By default, we should call This way, we default to the "reuse database" workflow, and folks can customize their composer.json file if they want to do something else, e.g. the re-install-Drupal-for-every-test workflow. |
@greg-1-anderson, just want to make sure I understand. So would That makes sense to me. I think having a standardized set of composer script names across repos will allow for needed variation within the steps. I am a little hesitant about the possibility of confusion that could come from composer scripts running locally to call remote composer scripts. |
Perhaps my naming conventions were off.
Perhaps these should be called The main purpose here is to keep the circle.yml script constant, and allow users to define the behavior of their project via composer scripts in their composer.json file. |
Maybe |
I like |
Hmm. Deep philosophical questions. If your "on-panetheon-create-env" script is only going to import your configuration options, then I would think that it would make a lot of sense to do this with a Quicksilver script, and do nothing extra in circle.yml / composer.json. However, if your "on-pantheon-create-env" script is going to re-install Drupal from scratch and import your test fixtures, then it might be kind of annoying to have this happen when you created a new multidev from the dashboard, if your intention was to make a copy of the dev environment for ad-hoc testing. I'm not sure I have the answer here; those are just a couple of use-cases to consider. |
Take a look at the current code diff here. This project now supports the following use-case:
Regarding parameter passing, if you define the following in a
And then run
In other words, all parameters are passed to every command in a compound script. This makes it inconvenient to move the current short installation script out of circle.yml into composer.json. We'd like to pass the parameters such as site name and admin password, which are defined as environment variables in the Circle UI, so this feature is not lost by the refactor. We could do that by placing the install instructions in a short script, and call the script from composer.json. I'd rather avoid adding another script here -- my goal is actually to get down to zero scripts in the template projects, if possible. In addition to that problem, we also need to consider what we should do if the user wants to run I'd like it if Drush would just do the chmods (see: drush-ops/drush#2664), but historically it avoids that operation. We'll see how that comes out. I tend to think that it would be reasonable to have Drush automatically switch to the config_installer if the profile is not specified, and configuration exists in the sync directory, and the config_installer exists. Heuristics for selecting the profile already exists. I'm not sure how to handle enabling So, in summary, it is currently working better to do the installation steps in circle.yml rather than composer.json. However, this leaves us with the original problem that the installation steps in circle.yml are not readily available to be called by |
The intention here is that different composer-based example repos will have different installation steps (WordPress, different install profiles, some installing with config_installer).
It makes sense to abstract the installation to a commonly named composer script that can be called by tools like https://github.com/pantheon-systems/terminus-build-tools-plugin. See https://github.com/pantheon-systems/terminus-build-tools-plugin/pull/3/files#r103558979