|
| 1 | +version: '2.1' |
| 2 | + |
| 3 | +################################################################################ |
| 4 | +# PARAMETERS |
| 5 | +################################################################################ |
| 6 | + |
| 7 | +parameters: |
| 8 | + run_update_dependencies: |
| 9 | + type: boolean |
| 10 | + default: false |
| 11 | + |
| 12 | +################################################################################ |
| 13 | +# JOBS |
| 14 | +################################################################################ |
| 15 | + |
| 16 | +jobs: |
| 17 | + # Self-hosted dependency updates. |
| 18 | + # Add the following environment variables to the CircleCI project: |
| 19 | + # - RENOVATE_TOKEN: GitHub access token. |
| 20 | + # - RENOVATE_REPOSITORIES: Repository to run Renovate on as `vendor/repository`. |
| 21 | + # - RENOVATE_GIT_AUTHOR: Author for Renovate commits as `Name <email@example.com>`. |
| 22 | + # Variables provided below can be overridden in the CircleCI project settings. |
| 23 | + update-dependencies: |
| 24 | + docker: |
| 25 | + - image: renovate/renovate:40.36.8 |
| 26 | + environment: |
| 27 | + RENOVATE_PLATFORM: 'github' |
| 28 | + RENOVATE_AUTODISCOVER: false |
| 29 | + RENOVATE_DEPENDENCY_DASHBOARD_TITLE: 'Renovate Dependency Dashboard (self-hosted) by CircleCI' |
| 30 | + RENOVATE_DEPENDENCY_DASHBOARD: false |
| 31 | + RENOVATE_DRY_RUN: false |
| 32 | + LOG_LEVEL: 'debug' |
| 33 | + |
| 34 | + steps: |
| 35 | + - checkout |
| 36 | + - run: |
| 37 | + name: Check if RENOVATE_TOKEN is set |
| 38 | + command: | |
| 39 | + if [ -z "${RENOVATE_TOKEN}" ]; then |
| 40 | + echo "RENOVATE_TOKEN is not set. Skipping job." |
| 41 | + circleci-agent step halt |
| 42 | + fi |
| 43 | +
|
| 44 | + if [ -z "${RENOVATE_REPOSITORIES}" ]; then |
| 45 | + echo "Renovate repository is not set. Skipping job." |
| 46 | + circleci-agent step halt |
| 47 | + fi |
| 48 | +
|
| 49 | + if [ -z "${RENOVATE_GIT_AUTHOR}" ]; then |
| 50 | + echo "Renovate git author is not set. Skipping job." |
| 51 | + circleci-agent step halt |
| 52 | + fi |
| 53 | +
|
| 54 | + - run: |
| 55 | + name: Validate Renovate configuration |
| 56 | + command: renovate-config-validator |
| 57 | + |
| 58 | + - run: |
| 59 | + name: Run Renovate |
| 60 | + command: renovate |
| 61 | + |
| 62 | +################################################################################ |
| 63 | +# WORKFLOWS |
| 64 | +################################################################################ |
| 65 | + |
| 66 | +workflows: |
| 67 | + version: 2 |
| 68 | + # Self-hosted Renovate workflow. |
| 69 | + update-dependencies: |
| 70 | + triggers: |
| 71 | + - schedule: |
| 72 | + cron: "5 11,23 * * *" |
| 73 | + filters: |
| 74 | + branches: |
| 75 | + only: |
| 76 | + - develop |
| 77 | + jobs: |
| 78 | + - update-dependencies |
| 79 | + |
| 80 | + update-dependencies-manual: |
| 81 | + when: << pipeline.parameters.run_update_dependencies >> |
| 82 | + jobs: |
| 83 | + - update-dependencies |
0 commit comments