Skip to content

Token replacement (e.g. #project.version# with the current version of the patch) of files via regular expressions #81

@daust

Description

@daust

Christoph made a great suggestions to replace placeholders during 1.copy or 3.install.

This way we could use a placeholder like #project.version# in the definition of the APEX application:
image

and replace this with the setting version in the opal-installer.json file:
image

This way we can make sure that the version information is ALWAYS correctly propagated the to the installed APEX version.
We could also use this to replace placeholders in the package files.

This can be done similar to the gradle build file that I am using. When building the software binaries and the distribution - zip file, I replace specific placeholder in some files, e.g. all files in the folder src/doc:
image

This could be implemented for example like this:

  "replacements": [
    {
      "fileRegEx": "/sql/.*apex.*/.*f*sql",
      "tokens": [{"#project.version#": "1.1"}, {"#var2#": "value2"}]
    },

The token values could ideally pick up values from environment variables or application/version in this opal-installer.json file itself. With that approach we could also limit the replacement using regular expressions to the files that we want to be affected. Working with replacements of text snippets in files can also have undesired side effects.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions