Skip to content

Commit

Permalink
[semver:minor] Add self-hosted Job (#3)
Browse files Browse the repository at this point in the history
* Add self-hosted Job

* Improve documentation
  • Loading branch information
daniel-shuy authored Oct 31, 2020
1 parent e649f26 commit 7fa7c5b
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to

## [Unreleased]

- Add `self-hosted` Job

## [1.0.0] - 2020-10-30

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/@orb.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

description: >
Orb for WhiteSource Renovate
Validate Renovate configuration files, or run a self-hosted instance of Renovate.
display:
home_url: https://renovatebot.com/
Expand Down
38 changes: 38 additions & 0 deletions src/examples/self-hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
description: |
Run a self-hosted instance of Renovate.
Authentication:
1. Create a bot account for the Git repository.
2. Generate a Personal Access Token for the bot account.
3. In Project Settings, configure the RENOVATE_REPOSITORY_AUTH_TOKEN environment variable (or alternately the name of environment variable passed into the repository_auth_token parameter) as the generated Personal Access Token.
For more information, see: https://github.com/renovatebot/renovate/blob/master/docs/usage/self-hosting.md#user-content-authentication
Configuration:
1. Create a Renovate self-hosted configuration file (eg. renovate.config.js).
2. Pass the file path into the config_file_path parameter.
3. Commit and push the changes to the branch configured in the schedule filter branch. This is usually the default branch (eg. master).
For more information, see:
- https://github.com/renovatebot/renovate/blob/master/docs/usage/self-hosting.md#user-content-configuration
- https://github.com/renovatebot/renovate/blob/master/docs/usage/self-hosted-configuration.md
- https://docs.renovatebot.com/self-hosted-configuration
For more information and examples, see: https://github.com/renovatebot/renovate/blob/master/docs/usage/self-hosting.md
The example below runs Renovate hourly:
usage:
version: 2.1
orbs:
renovate: daniel-shuy/renovate@x.y
workflows:
renovate:
nightly:
triggers:
- schedule:
cron: "0 * * * *"
filters:
branches:
only:
- master
jobs:
- renovate/self-hosted:
config_file_path: renovate.config.js
5 changes: 4 additions & 1 deletion src/examples/validate-config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
description: Validate Renovate configuration file (see https://docs.renovatebot.com/configuration-options/ for configuration options).
description: |
Validate Renovate configuration file.
Configuration file definition: https://docs.renovatebot.com/configuration-options/
usage:
version: 2.1
Expand Down
8 changes: 5 additions & 3 deletions src/examples/validate-self-hosted-config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
description: >
Validate Renovate configuration file (see https://docs.renovatebot.com/configuration-options/ for configuration options)
and self-hosted configuration file (see https://github.com/renovatebot/renovate/blob/master/docs/usage/self-hosting.md#user-content-configuration).
description: |
Validate Renovate configuration file and self-hosted configuration file.
Configuration file definition: https://docs.renovatebot.com/configuration-options/
Self-hosted configuration file docs: https://github.com/renovatebot/renovate/blob/master/docs/usage/self-hosting.md#user-content-configuration
usage:
version: 2.1
Expand Down
46 changes: 46 additions & 0 deletions src/jobs/self-hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
description: >
Run a self-hosted instance of Renovate.
executor:
name: default
tag: "\
<<# parameters.renovate_version >>\
<< parameters.renovate_version >><<# parameters.slim >>-slim<</ parameters.slim >>\
<</ parameters.renovate_version >>\
<<^ parameters.renovate_version >>\
<<# parameters.slim >>\
slim\
<</ parameters.slim >>\
<<^ parameters.slim >>\
latest\
<</ parameters.slim >>\
<</ parameters.renovate_version >>\
"

parameters:
repository_auth_token:
type: env_var_name
default: RENOVATE_REPOSITORY_AUTH_TOKEN
description: |
Environment variable name for the Git repository Personal Auth Token for the bot account.
See https://github.com/renovatebot/renovate/blob/master/docs/usage/self-hosting.md#user-content-authentication
config_file_path:
type: string
default: config.js
description: Path to configuration file (see https://docs.renovatebot.com/self-hosted-configuration/ for configuration options).
renovate_version:
type: string
default: ""
description: Version of Renovate to run (if no version is specified, runs the latest version).
slim:
type: boolean
default: false
description: |
Use "slim" Docker images to reduce startup time.
Set to true if you only use package managers that don't need third party binaries (e.g. JS, Docker, Nuget, pip).
steps:
- checkout
- run:
name: Execute Renovate CLI
command: renovate --token ${<< parameters.repository_auth_token >>}
6 changes: 4 additions & 2 deletions src/jobs/validate-config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
description: >
Validate Renovate configuration file (see https://docs.renovatebot.com/configuration-options/ for configuration options)
and/or self-hosted configuration file (see https://github.com/renovatebot/renovate/blob/master/docs/usage/self-hosting.md#user-content-configuration)
Validate Renovate configuration file and/or self-hosted configuration file.
Configuration file definition: https://docs.renovatebot.com/configuration-options/
Self-hosted configuration file docs: https://github.com/renovatebot/renovate/blob/master/docs/usage/self-hosting.md#user-content-configuration
executor:
name: default
Expand Down

0 comments on commit 7fa7c5b

Please sign in to comment.