Skip to content

Commit

Permalink
docs: add bitbucket samples (renovatebot#99)
Browse files Browse the repository at this point in the history
Co-authored-by: HonkingGoose <[email protected]>
  • Loading branch information
viceice and HonkingGoose authored Dec 8, 2020
1 parent c446241 commit 3f3cbd8
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ For the `latest` image see [here](https://github.com/renovatebot/docker-renovate

## Usage

See [docs](https://docs.renovatebot.com/self-hosting/) for additional information to self-hosting renovate with docker.
Read the [self-hosting docs](https://docs.renovatebot.com/self-hosting/) for more information on how to self-host Renovate with Docker.


See [Gitlab docs](./docs/gitlab.md) for some gitlab configuration samples.
See [Gitlab](./docs/gitlab.md) or [Bitbucket](./docs/bitbucket.md) docs for more configuration samples.


### Samples
Expand Down
87 changes: 87 additions & 0 deletions docs/bitbucket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Samples for Bitbucket pipelines

These are configuration examples for running a self-hosted Renovate on bitbucket.org pipelines.

### bitbucket-pipelines.yml
```yml
image: renovate/renovate:23.96.2-slim

definitions:
caches:
renovate: renovate

pipelines:
default:
- step:
name: renovate dry-run
services:
- docker
caches:
- docker
script:
- export LOG_LEVEL=debug RENOVATE_CONFIG_FILE="$BITBUCKET_CLONE_DIR/config.js"
- renovate --dry-run
branches:
master:
- step:
name: renovate
services:
- docker
caches:
- docker
script:
- export LOG_LEVEL=debug RENOVATE_CONFIG_FILE="$BITBUCKET_CLONE_DIR/config.js"
- renovate
```
### config.js
Example of manual repository config:
```js
module.exports = {
platform: 'bitbucket',
username: process.env.USERNAME,
password: process.env.PASSWORD,
baseDir: `${process.env.BITBUCKET_CLONE_DIR}/renovate`,
repositories: [ "user1/repo1", "orh/repo2" ],
}
```

Using autodiscover:
```js
module.exports = {
platform: 'bitbucket',
username: process.env.USERNAME,
password: process.env.PASSWORD,
baseDir: `${process.env.BITBUCKET_CLONE_DIR}/renovate`,
autodiscover: true,
}
```

### renovate.json
Use this for self-update Renovate:
```json
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [ "config:base" ],
"regexManagers": [
{
"fileMatch": ["^bitbucket-pipelines.yml$"],
"matchStrings": [
"image: (?<depName>[a-z/-]+)(?::(?<currentValue>[a-z0-9.-]+))?(?:@(?<currentDigest>sha256:[a-f0-9]+))?"
],
"datasourceTemplate": "docker",
"versioningTemplate": "docker"
}
]
}
```

### Variables
You need to define pipeline variables:
- `USERNAME`: Bitbucket.org username
- `PASSWORD`: Bitbucket.org password
- `GITHUB_COM_TOKEN`: GitHub token to fetch changelog (optional, highly recommended)

### Schedule

Configure a `hourly` schedule on `master` branch with `branches: master` pipeline.

0 comments on commit 3f3cbd8

Please sign in to comment.