diff --git a/docs/usage/setup-azure-devops.md b/docs/usage/setup-azure-devops.md index a6614953bc8430577842d44fa711c02c29598b64..655653b153928b55767c56b494aa30ef45b73e80 100644 --- a/docs/usage/setup-azure-devops.md +++ b/docs/usage/setup-azure-devops.md @@ -5,72 +5,91 @@ description: How to setup Renovate for Azure DevOps # Azure DevOps setup -1. Create a brand new pipeline within Azure DevOps, and select your source -  -1. Select your repository -1. Within _Configure your pipeline_ select: **Starter pipeline file** -  -1. Replace all contents with: - - ``` - schedules: - - cron: '0 3 * * *' - displayName: 'Every day at 3am' - branches: - include: [master] - - trigger: none - - pool: - vmImage: ubuntu-latest - - steps: - - task: npmAuthenticate@0 - inputs: - workingFile: .npmrc - - - bash: | - git config --global user.email 'bot@renovateapp.com' - git config --global user.name 'Renovate Bot' - npx --userconfig .npmrc renovate - env: - TOKEN: $(System.AccessToken) - ``` - -1. Add a file named `.npmrc` to your repository with the following contents: - (replacing `YOUR-ORG` with your Azure DevOps organization and `YOUR-FEED` with your Azure Artifacts feed) - - ``` - registry=https://pkgs.dev.azure.com/YOUR-ORG/_packaging/YOUR-FEED/npm/registry/ - always-auth=true - ``` - -1. Add a file named `config.js` to your repository with the following contents: - (replacing `YOUR-ORG` with your Azure DevOps organization and `YOUR-PROJECT/YOUR-REPO` with your Azure DevOps project and repository) - - ```javascript - module.exports = { - platform: 'azure', - endpoint: 'https://dev.azure.com/YOUR-ORG/', - token: process.env.TOKEN, - hostRules: [ - { - hostName: 'pkgs.dev.azure.com', - username: 'apikey', - password: process.env.TOKEN, - }, - ], - repositories: ['YOUR-PROJECT/YOUR-REPO'], - }; - ``` - -1. Additionally, you can add `renovate.json` with Renovate configurations in the root of the repo. [Read more about configurations options](https://docs.renovatebot.com/configuration-options/) - -If you wish to use a single Renovate pipeline to update multiple repositories: - -1. Add the names of the repositories to `config.js`. - -1. Make sure that the "Project Collection Build Service (YOUR-PROJECT)" user has the following permissions on the repositores: - - Contribute - - Contribute to pull requests - - Create branch +This document explains how to setup Renovate for use on Azure DevOps. + +## Setting up a new pipeline + +Create a brand new pipeline within Azure DevOps, and select your source: + + +Then select your repository. + +Within _Configure your pipeline_ select: **Starter pipeline** + + +Replace _all_ content in the starter pipeline with: + +```yaml +schedules: + - cron: '0 3 * * *' + displayName: 'Every day at 3am' + branches: + include: [master] + +trigger: none + +pool: + vmImage: ubuntu-latest + +steps: + - task: npmAuthenticate@0 + inputs: + workingFile: .npmrc + + - bash: | + git config --global user.email 'bot@renovateapp.com' + git config --global user.name 'Renovate Bot' + npx --userconfig .npmrc renovate + env: + TOKEN: $(System.AccessToken) +``` + +## Create a .npmrc file + +Create a `.npmrc` file in your repository: + +```ini +registry=https://pkgs.dev.azure.com/YOUR-ORG/_packaging/YOUR-FEED/npm/registry/ +always-auth=true +``` + +For the `registry` key, replace `YOUR-ORG` with your Azure DevOps organization and `YOUR-FEED` with your Azure Artifacts feed. + +## Create a config.js file + +Create a `config.js` file in your repository: + +```javascript +module.exports = { + platform: 'azure', + endpoint: 'https://dev.azure.com/YOUR-ORG/', + token: process.env.TOKEN, + hostRules: [ + { + hostName: 'pkgs.dev.azure.com', + username: 'apikey', + password: process.env.TOKEN, + }, + ], + repositories: ['YOUR-PROJECT/YOUR-REPO'], +}; +``` + +For the `endpoint` key, replace `YOUR-ORG` with your Azure DevOps organization. +For the `repositories` key, replace `YOUR-PROJECT/YOUR-REPO` with your Azure DevOps project and repository. + +### Add renovate.json file + +Additionally, you can create a `renovate.json` file which holds the Renovate configuration, in the root of the repo. +[Read more about the Renovate configuration options](https://docs.renovatebot.com/configuration-options/) + +### Using a single pipeline to update multiple repositories + +If you want to use a single Renovate pipeline to update multiple repositories you must take the following steps. + +Add the names of the repositories to `config.js`. +Make sure that the "Project Collection Build Service (YOUR-PROJECT)" user has the following permissions on the repositories: + +- Contribute +- Contribute to pull requests +- Create branch