How to get automated updates with renovate? #10003
Replies: 4 comments 3 replies
-
I'll share how we've set this up when I'm back at my computer (need to not forget) |
Beta Was this translation helpful? Give feedback.
-
Hi, in case you are using GitHub actions we wrote an action for that: https://github.com/jscutlery/semver/blob/main/.github/workflows/nx-migrate.yml |
Beta Was this translation helpful? Give feedback.
-
Here's how we've setup Renovate postUpgradeTasks to automate Nx upgrades and migrations. Pieced these together through trial and error and finding some examples online (I'll link to them if I can find them). A couple of prerequisites:
The best setup I've found is to extend the normal Nrwl group from Renovate, apply and run migrations explicitly from the prior version to the new version. This will show all of the Nrwl packages updated by Renovate together
{
"extends": ["config:base"],
"packageRules": [
{
"extends": "monorepo:nrwl",
"groupName": "Nrwl Nx monorepo",
"postUpgradeTasks": {
"commands": [
"npx nx migrate @nrwl/workspace@{{{newVersion}}} --from=@nrwl/workspace@{{{currentVersion}}}",
"npm install && [ -f migrations.json ] && npx nx migrate --run-migrations=migrations.json"
],
"fileFilters": [
"**/**"
],
"executionMode": "branch"
}
}
]
} |
Beta Was this translation helpful? Give feedback.
-
Meanwhile npx nx migrate @nrwl/workspace@{{{newVersion}}} --from=@nrwl/workspace@{{{currentVersion}}}
npx nx migrate --run-migrations=migrations.json --create-commits --ifExists |
Beta Was this translation helpful? Give feedback.
-
If using renovate to automatically update dependencies, I need some way of trying to run the nx migrate command instead. Do you have any suggested methods for this? I've been trying to use a postUpgradeTask, however this occurs after the versions have been bumped, so no migrations are run.
I continually have to do these manually, just in case there is a migration. Does anyone have any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions