Skip to content

Ability to run "migration script" on update #971

Closed
@hohwille

Description

@hohwille

When we publish a new release, our users can install it to existing devonfw-ide installations via devon ide update scripts.
Sometimes we do some structural changes, here is a brief history with just some examples:

  • we have changed the eclipse configuration structure in settings/eclipse/workspace
  • we have moved the eclipse plugin configuration from hard-coded settings to settings/eclipse/plugins
  • we are planning to migrate from ide-mirrors to ide-urls

Due to such changes we sometimes "pollute" our scripts/commandlets with legacy handling code (see #904 or see ide commandlet with blocks of cp and mv commands, etc.).

Instead, we should create a bash script scripts/migration where we can place logic that would be executed automatically by devon ide update scripts but at the end on the new release.
To avoid mistakes and make things simple for developers, I would propose that the migration script gets called with the previous version of devonfw-ide that just has been updated. We create a subfolder scripts/migrations where we can create scripts for specific migrations named by the source version. So e.g. when we have version 2022.11.001 installed and call devon ide update scripts then migrate script would find all scripts in migrations subfolder that are named by a version greater or equal to 2022.11.001 so he may find migrations/2022.12.001 and execute it. In case someone knows flyway or liquibase this is the same pattern that we are trying to implement here...

We can still discuss if we need to track the version of devonfw-ide itself for reliability (e.g. in .devon.software.version file in DEVON_IDE_HOME).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions