drupal-project
drupal-project copied to clipboard
Update drupal-composer
What is the best way to keep drupal-composer up to date?
Any news here?
I think doing a manual diff it still the best approach. Maybe we should file which contains the git revision from the initial install?
We can add drupal-composer project as additional origin to GIT and cherry-pick one commit or range of commits to your current project.
git remote add drupal-composer https://github.com/drupal-composer/drupal-project.git
git cherry-pick hash_from^..latest_hash
There is a chance to have big troubles with merging some files (like .gitignore or composer.json). So, doing a manual diff it still the best approach in most cases.
The one quick thing that would be great to implement is to have versioning history of drupal-composer. So we will be able easily to detect version of drupal-composer we're using locally. And how long it is outdated from this repo.
I have a "one year" old project (still in dev) based on drupal-composer and recently I've re-started to work on it.
I did a core upgrade from:
"drupal/core": "~8.4"
to
"drupal/core": "^8.6.0"
using:
composer update drupal/core webflo/drupal-core-require-dev symfony/* --with-dependencies
as advised in this project front page, and everything seems to have gone well despite the lack of 'webflo/drupal-core-require-dev' as dependency: no errors, the site is working.
obviously my composer.json is very dated, for example, as I wrote above, I still have this:
"require-dev": {
"behat/mink": "~1.7",
"behat/mink-goutte-driver": "~1.2",
"drupal/devel": "^1.0",
"jcalderonzumba/gastonjs": "~1.0.2",
"jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
"mikey179/vfsstream": "~1.2",
"phpunit/phpunit": ">=4.8.28 <5",
"symfony/css-selector": "~2.8|~3.0"
},
instead of recent:
"require-dev": {
"webflo/drupal-core-require-dev": "^8.6.0"
},
The question is: should I update the composer.json to the most recent one?
In this case: is the only action I have to do is to upgrade my old composer.json with a DIFF with the most recent one? Is this enough? Nothing else? (e.g. other drupal-composer folders/files, I don't know...)
Thank you for any clarification/help
Refs #425
Also, I'm looking to upgrade a couple year old project and it would be nice if the README at least mentioned that any updates to drupal-composer/drupal-project itself need to be done manually.
I'm about to start copying and pasting new bits from the new composer.json into the old and seeing what breaks, or not.
If there's a better way then please holler.
I'm not sure how you automate it, but I upgraded to the latest version of this repo.
I copied any custom installed packages from our older, existing composer.json "require" and "require-dev" sections and appended them to the new composer.json from the latest repo. That combined file was the core of the upgrading.
Then, I manually copied new files and directories (/drush, /script) from a clone of the latest drupal-composer/drupal-project/ into the existing composer project I was upgrading.
It worked pretty seamlessly after the manual work, plus a composer install, drush updb, and drush cache-rebuild.
I would do it manually. You don't need to do it regularly in my opinion but credit to anyone that is. I might revisit the scaffold every year. I take the latest composer.json (and anything else important like scripts) from composer-project, and then retrofit any customisations from my project into it the clean version.