Self-Hosted-Renovate: Env. Secrets usage in config.js #237
-
Hi, we use the helm chart to run a Self-Hosted renovate. At the moment we are working to integrate the access on our internal Artifactory to check for new Images, but we struggle a little bit with the configuration of the config.js file. We configured the secrets block in the helm chart like this:
The renovate-secret is still there and the secret variables are available in the POD and env. variables. The renovate.json in the REPO looks like this:
If we now start a Renovate run the secret variable is not used and it end with the following errror:
We want to configure the module.export part in the config.js, but it's not working and the env variables are not used.
If we use module.export:
Helm chart: renovate-32.9.3
We tried some different spellings and variants to configure it, but none was working. Maybe, someone here know the answer :-) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
@dschunack I encountered the same difficulty as you and while I didn't make it work within using an inline
The helm values I set for testing were:
With the above you can set repo configs to use the secrets in |
Beta Was this translation helpful? Give feedback.
-
Closing this issue, as it works as intended. By default we use a Maybe @marsdalesa Can open a PR to add this sample to the readme ? |
Beta Was this translation helpful? Give feedback.
-
Adding customizations to Example: renovate:
# See https://docs.renovatebot.com/self-hosted-configuration
config: |
{
. . .
}
# when custom_config.js is set, it creates a configmap with its content and mount it on /usr/src/app/config.js
custom_config.js: |
module.exports = {
platform: "github",
repositories: ["xxxx/xxxxx"],
hostRules: [
{
matchHost: "https://xxxx.jfrog.io/xxxx/xxxxx-charts/",
username: process.env.ARTIFACTORY_USER,
password: process.env.ARTIFACTORY_TOKEN
}
],
secrets: {
ARTIFACTORY_TOKEN: process.env.ARTIFACTORY_TOKEN,
ARTIFACTORY_USER: process.env.ARTIFACTORY_USER
}
} |
Beta Was this translation helpful? Give feedback.
@dschunack I encountered the same difficulty as you and while I didn't make it work within using an inline
renovate.config
I did manage to make this work by exploitingextraConfigmaps
,extraVolumes
,extraVolumeMounts
and settingexistingConfigFile
. This way, I was able to make aconfig.js
that can use the renovate docs examples. The k8s secretrenovate-env
contains the secret values e.g.:The helm values I set …