renovatebot / config-help

Please use the Discussions feature of https://github.com/renovatebot/renovate instead

Home Page:https://github.com/renovatebot/renovate/discussions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to configure renovate-bot for bitbucket-server

mehrad-rafigh opened this issue · comments

Which Renovate are you using?

Renovate Open Source CLI

Which platform are you using?

Bitbucket Server

Have you checked the logs? Don't forget to include them if relevant

Logs from local run

DEBUG: File config
       "config": {}
DEBUG: CLI config
       "config": {"logLevel": "debug"}
DEBUG: Env config
       "config": {"hostRules": [], "binarySource": "docker"}
DEBUG: Combined config
       "config": {"hostRules": [], "binarySource": "docker", "logLevel": "debug"}
FATAL: You must configure a GitHub personal access token
DEBUG: Renovate exiting
 INFO: Renovate is exiting with a non-zero code due to the following logged errors
       "loggerErrors": [
         {
           "name": "renovate",
           "level": 60,
           "logContext": "0RHnUTZXd",
           "msg": "You must configure a GitHub personal access token"
         }
       ]

What would you like to do?

I can't get the self hosted renovate bot up and running. I searched for some issues here, but they did not solve my issue.
I am trying to run renovate bot on our bitbucket server

I renamed the config.js to renovate.config.js. The content of that file is

module.export = {
  platform: "bitbucket-server",
  username: "my-username",
  password: "super-secret-token",
  endpoint: "https://comayn-address.de/bitbucket",
  repositories: ["repo-i-like-to-use"],
  allowPostUpgradeCommandTemplating: true,
  allowedPostUpgradeCommands: ["^npm ci --ignore-scripts$", "^npx ng update"],
  gitAuthor: "my-username",
  onboarding: false,
  logLevel: "debug",
  dryRun: true,
  autodiscover: true,
  packageRules: [
    {
      packageNames: ["@nrwl/workspace"],
      packagePatterns: ["^@nrwl/"],
      groupName: "Nrwl workspace",
      postUpgradeTasks: {
        commands: [
          "npm ci --ignore-scripts",
          "npx ng update {{{depName}}} --from={{{fromVersion}}} --to={{{toVersion}}} --migrateOnly --allowDirty --force"
        ],
        fileFilters: ["**/**"]
      }
    },
    {
      packageNames: ["@angular/core"],
      packagePatterns: ["^@angular/"],
      groupName: "Angular monorepo",
      allowedVersions: "< 11",
      postUpgradeTasks: {
        commands: [
          "npm ci --ignore-scripts",
          "npx ng update {{{depName}}} --from={{{fromVersion}}} --to={{{toVersion}}} --migrateOnly --allowDirty --force",
          "npx ng update @angular/cli --from={{{fromVersion}}} --to={{{toVersion}}} --migrateOnly --allowDirty --force",
          "npx ng update @angular/material --from={{{fromVersion}}} --to={{{toVersion}}} --migrateOnly --allowDirty --force",
          "npx ng update @angular/cdk --from={{{fromVersion}}} --to={{{toVersion}}} --migrateOnly --allowDirty --force",
          "npx ng update @angular/flex-layout --from={{{fromVersion}}} --to={{{toVersion}}} --migrateOnly --allowDirty --force"
        ],
        fileFilters: ["**/**"]
      }
    },
    {
      packageNames: ["@nguniversal/express-engine"],
      allowedVersions: "< 11",
      postUpgradeTasks: {
        commands: [
          "npm ci --ignore-scripts",
          "npx ng update {{{depName}}} --from={{{fromVersion}}} --to={{{toVersion}}} --migrateOnly --allowDirty --force"
        ],
        fileFilters: ["**/**"]
      }
    }
  ]
};

When I run docker run --rm -v "/home/mehrad/dev/carglass-enterprise-frontends/renovate.config.js:/usr/src/app/config.js" renovate/renovate:slim --log-level debug I get the error, which I mentioned above.

DEBUG: File config
       "config": {}
DEBUG: CLI config
       "config": {"logLevel": "debug"}
DEBUG: Env config
       "config": {"hostRules": [], "binarySource": "docker"}
DEBUG: Combined config
       "config": {"hostRules": [], "binarySource": "docker", "logLevel": "debug"}
FATAL: You must configure a GitHub personal access token
DEBUG: Renovate exiting
 INFO: Renovate is exiting with a non-zero code due to the following logged errors
       "loggerErrors": [
         {
           "name": "renovate",
           "level": 60,
           "logContext": "0RHnUTZXd",
           "msg": "You must configure a GitHub personal access token"
         }
       ]

checkout https://docs.renovatebot.com/self-hosting/

config file need to be config.js or config.json in current directory

@viceice Nah won't work. I get the same error. The volume binding should just work right, since I am using that same schema for many other volume mappings with docker

please add -e LOG_LEVEL=debug to docker command, otherwise you loose some debug messages

you also need to mount the docker socket, otherwise renovate can't run npm later.

can you try to run docker run --rm -v "/home/mehrad/dev/carglass-enterprise-frontends/renovate.config.js:/usr/src/app/config.js" renovate/renovate:slim cat config.js ? Should print your config

please add -e LOG_LEVEL=debug to docker command, otherwise you loose some debug messages

➜ docker run --rm -v "/home/mehrad/dev/carglass-enterprise-frontends/config.js:/usr/src/app/config.js" -e LOG_LEVEL=debug renovate/renovate:slim
DEBUG: Using RE2 as regex engine
DEBUG: Parsing configs
DEBUG: Checking for config file in /usr/src/app/config
DEBUG: File config
"config": {}
DEBUG: CLI config
"config": {}
DEBUG: Env config
"config": {"hostRules": [], "binarySource": "docker", "logLevel": "debug"}
DEBUG: Combined config
"config": {"hostRules": [], "binarySource": "docker", "logLevel": "debug"}
FATAL: You must configure a GitHub personal access token
DEBUG: Renovate exiting
INFO: Renovate is exiting with a non-zero code due to the following logged errors
"loggerErrors": [
{
"name": "renovate",
"level": 60,
"logContext": "mWtMj922L",
"msg": "You must configure a GitHub personal access token"
}
]
Same output.

can you try to run docker run --rm -v "/home/mehrad/dev/carglass-enterprise-frontends/renovate.config.js:/usr/src/app/config.js" renovate/renovate:slim cat config.js ? Should print your config

Yes it does. The same config file I mentioned above

ha, needs to be module.exports <-- see the s 🙃

https://docs.renovatebot.com/self-hosting/#usage

facepalm
Thank you @viceice