1

I'm using Renovate in self hosted Gitlab to update my AWS-CDK projects. This works so far, but I figured that Renovate is not using AWS-Codeartifact URLs for package-log.json. Instead there are URLs to registry.npmjs.org

This is my renovate.json inside of a CDK project

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": [
    "config:base"
  ],
  "prHourlyLimit": 0,
  "rangeStrategy":"update-lockfile"
}

This is an example snippet of package-lock.json currently generated by Renovate

"constructs": {
  "integrity": "sha512-MIwjmrXZpM9RtwyrSD4HotDIQl8HTdIefQhU+MU1asvtSyVN3kK8kjeUOWMFb+fdyT4RX3QvvcaaPBluLEX1SA=="
  "version": "10.2.69",
  "resolved": "https://registry.npmjs.org/constructs/-/constructs-10.2.69.tgz",
  "integrity": "sha512-0AiM/uQe5Uk6JVe/62oolmSN2MjbFQkOlYrM3fFGZLKuT+g7xlAI10EebFhyCcZwI2JAcWuWCmmCAyCothxjuw=="
},

But I like it to look like this

"constructs": {
  "integrity": "sha512-MIwjmrXZpM9RtwyrSD4HotDIQl8HTdIefQhU+MU1asvtSyVN3kK8kjeUOWMFb+fdyT4RX3QvvcaaPBluLEX1SA=="
  "version": "10.2.69",
  "resolved": "https://domain-012345678901.d.codeartifact.region.amazonaws.com:443/npm/repo/constructs/-/
  "integrity": "sha512-0AiM/uQe5Uk6JVe/62oolmSN2MjbFQkOlYrM3fFGZLKuT+g7xlAI10EebFhyCcZwI2JAcWuWCmmCAyCothxjuw=="
},

How can I achieve this?

I tried to extend renovate.json by defaultRegistryUrls property without success

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "defaultRegistryUrls": ["https://domain-012345678901.d.codeartifact.region.amazonaws.com:443/npm/repo"],
  "extends": [
    "config:base"
  ],
  "prHourlyLimit": 0,
  "rangeStrategy":"update-lockfile"
}
Gaël J
  • 11,274
  • 4
  • 17
  • 32
DerKnorr
  • 78
  • 5

1 Answers1

0

You need to define a npmrc attribute in your Renovate configuration with the same content as you'd have in your .npmrc file on your laptop or CI:

{
  "npmrc": "registry=..."
}

If I remember well, this should be sufficient. If not, you might need to add a packageRule as well.

Gaël J
  • 11,274
  • 4
  • 17
  • 32