Skip to content
Snippets Groups Projects
Select Git revision
1 result Searching

additional-namespaces.jsonnet

Blame
  • self-hosted-configuration.md 31.48 KiB
    title: Self-Hosted configuration
    description: Self-Hosted configuration usable in config file, CLI or environment variables

    Self-Hosted configuration options

    You can only use these configuration options when you're self-hosting Renovate.

    Please also see Self-Hosted Experimental Options.

    !!! note Config options with type=string are always non-mergeable, so mergeable=false.

    allowCustomCrateRegistries

    allowPlugins

    allowPostUpgradeCommandTemplating

    Set to true to allow templating of dependency level post-upgrade commands.

    Let's look at an example of configuring packages with existing Angular migrations.

    Add two properties to config.js: allowPostUpgradeCommandTemplating and allowedPostUpgradeCommands:

    module.exports = {
      allowPostUpgradeCommandTemplating: true,
      allowedPostUpgradeCommands: ['^npm ci --ignore-scripts$', '^npx ng update'],
    };

    In the renovate.json file, define the commands and files to be included in the final commit.

    The command to install dependencies (npm ci --ignore-scripts) is needed because, by default, the installation of dependencies is skipped (see the skipInstalls global option).

    {
      "packageRules": [
        {
          "matchPackageNames": ["@angular/core"],
          "postUpgradeTasks": {
            "commands": [
              "npm ci --ignore-scripts",
              "npx ng update {{{depName}}} --from={{{currentVersion}}} --to={{{newVersion}}} --migrate-only --allow-dirty --force"
            ],
            "fileFilters": ["**/**"]
          }
        }
      ]
    }

    With this configuration, the executable command for @angular/core looks like this:

    npm ci --ignore-scripts
    npx ng update @angular/core --from=10.0.0 --to=11.0.0 --migrate-only --allow-dirty --force

    allowScripts

    allowedPostUpgradeCommands

    A list of regular expressions that decide which commands in postUpgradeTasks are allowed to run. If this list is empty then no tasks will be executed.