Skip to content

How to use env variables within config.json #8393

Answered by mhubig
mhubig asked this question in Request Help
Discussion options

You must be logged in to vote

So the js equivalent of my config.json file would be something like this?

module.exports = {
  dryRun: true,
  logLevel: "debug",
  platform: "gitlab",
  token: `${process.env.GITLAB_TOKEN}`,
  endpoint: "https://my.gitlab.com/api/v4",
  gitAuthor: "Renovate Bot <[email protected]>",
  autodiscover: true,
  autodiscoverFilter: "apps/**",
  npmrc: `@dm:registry=my.artifactory.com/api/npm/repo-my\n//my.artifactory.com/api/npm/:_authToken=${process.env.NPM_TOKEN}`,
  hostRules: [
    {
      "platform": "maven",
      "endpoint": "https://my.artifactory.com",
      "username": `${process.env.ARTIFACTORY_USERNAME}`,
      "password": `${process.env.ARTIFACTORY_PASSWORD}`
    }
  ]
}

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@viceice
Comment options

Comment options

You must be logged in to vote
2 replies
@viceice
Comment options

@mhubig
Comment options

Answer selected by viceice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants