Created
May 11, 2020 21:16
-
-
Save JamieMagee/c7a3459352658886d1d62172527c2e23 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schedules: | |
- cron: '0 * * * *' | |
displayName: 'Hourly' | |
branches: | |
include: | |
- master | |
always: true | |
trigger: none | |
jobs: | |
- job: | |
pool: | |
vmImage: 'ubuntu-latest' | |
steps: | |
- checkout: none | |
- task: Bash@3 | |
displayName: Create .npmrc file | |
inputs: | |
targetType: inline | |
script: | | |
cat > .npmrc << EOF | |
registry=https://MYORGANISATION.pkgs.visualstudio.com/_packaging/MYPROJECT/npm/registry/ | |
always-auth=true | |
EOF | |
- task: npmAuthenticate@0 | |
displayName: npm Authenticate | |
inputs: | |
workingFile: .npmrc | |
- task: Bash@3 | |
displayName: Create renovate config | |
inputs: | |
targetType: inline | |
script: | | |
cat > config.js << EOF | |
module.exports = { | |
// Azure DevOps instance | |
platform: 'azure', | |
endpoint: 'https://dev.azure.com/MYORGANISATION/', | |
token: '$(System.AccessToken)', | |
azureWorkItemId: 225958, | |
// For testing | |
dryRun: false, | |
includeForks: true, | |
logLevel: 'debug', | |
// Don't require renovate.json in repository | |
onboarding: false, | |
requireConfig: false, | |
// Private npm repos | |
npmrc: | |
'$(sed ':a;N;$!ba;s/\n/\\n/g' .npmrc)', | |
ignoreNpmrcFile: true, | |
// Private Maven repo | |
hostRules: [ | |
{ | |
hostName: 'pkgs.dev.azure.com', | |
username: 'renovate', | |
password: '$(System.AccessToken)' | |
}, | |
{ | |
hostName: 'MYORGANISATION.pkgs.visualstudio.com', | |
username: 'renovate', | |
password: '$(System.AccessToken)' | |
} | |
], | |
// Repo to renovate | |
repositories: [...] | |
}; | |
EOF | |
- task: Bash@3 | |
displayName: Run renovate | |
inputs: | |
targetType: inline | |
script: | | |
# Git credentials | |
git config --global user.email '[email protected]' | |
git config --global user.name 'Renovate Bot' | |
# Run renovate | |
npx renovate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment