Renovate
Renovate is an open source tool for keeping dependencies up to date automatically via pull requests. It is an alternative toGreenkeeper that only works withGitHub.
Bitbucket Pipelines
Bitbucket Pipelines brings continuous integration and delivery toBitbucket Cloud, empowering teams to build, test, and deploy their code within Bitbucket.
But how does Renovate work with Bitbucket Pipelines?
The first thing we need is a new repository with apackage.json
:
{"name":"renovate","version":"1.0.0","description":"Multi-language dependency update automation","private":true,"scripts":{"start":"renovate"},"devDependencies":{"renovate":"^14.50.3"}}
Authentication
It is recommended to create a separate Bitbucket user (e.g.renovate-bot
) for Renovate.
After thatcreate an app password and store it in theRENOVATE_PASSWORD
environment variable.
Pipeline
In the root directory create the filebitbucket-pipelines.yml
with the following content:
image:atlassian/default-image:2pipelines:custom:renovate:-step:caches:-nodescript:-git config --global user.email "bot@renovateapp.com"-git config --global user.name "Renovate Bot"-npm install-npm start
Use theatlassian/default-image:2
image because it comes with Node.js and Git by default.
Configuration
Renovate needs aconfiguration. Create this in the root directory. An exampleconfig.js
looks like this:
module.exports={platform:'bitbucket',gitAuthor:'Renovate Bot <bot@renovateapp.com>',username:'renovate-bot',onboarding:true,onboardingConfig:{extends:['config:base']},repositories:['YOUR_USERNAME/YOUR_REPOSITORY','YOUR_USERNAME/YOUR_REPOSITORY','YOUR_USERNAME/YOUR_REPOSITORY']}
Very important are theplatform
andusername
keys. The value of theusername
is the new user from step 1.
Test Run
Now you canmanually trigger the pipeline from Bitbucket Cloud.
An initial pull request is now created in the specified repositories.
Scheduled Pipelines
With thescheduled pipelines feature you can run the pipeline automatically at certain times.
Top comments(1)
For further actions, you may consider blocking this person and/orreporting abuse