-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow to override docker command and user (#783)
Co-authored-by: Michael Kriese <[email protected]>
- Loading branch information
1 parent
577b358
commit 8d4ffe3
Showing
6 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ GitHub Action to run Renovate self-hosted. | |
- [Badges](#badges) | ||
- [Options](#options) | ||
- [`configurationFile`](#configurationfile) | ||
- [`docker-cmd-file`](#docker-cmd-file) | ||
- [`docker-user`](#docker-user) | ||
- [`env-regex`](#env-regex) | ||
- [`mount-docker-socket`](#mount-docker-socket) | ||
- [`token`](#token) | ||
|
@@ -65,6 +67,53 @@ This disables the requirement of a configuration file for the repository and dis | |
requireConfig: false, | ||
``` | ||
|
||
### `docker-cmd-file` | ||
|
||
Specify a command to run when the image start. | ||
By default the image run | ||
`renovate`. | ||
This option is useful to customize the image before running `renovate`. | ||
It must be an existing executable file on the local system. | ||
It will be mounted to the docker container. | ||
|
||
For example you can create a simple script like this one (let's call it | ||
`renovate-entrypoint.sh`). | ||
|
||
```sh | ||
#!/bin/bash | ||
|
||
apt update | ||
|
||
apt install -y build-essential libpq-dev | ||
|
||
runuser -u ubuntu renovate | ||
``` | ||
|
||
Now use this action | ||
|
||
```yml | ||
.... | ||
jobs: | ||
renovate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Self-hosted Renovate | ||
uses: renovatebot/[email protected] | ||
with: | ||
docker-cmd-file: .github/renovate-entrypoint.sh | ||
docker-user: root | ||
token: ${{ secrets.RENOVATE_TOKEN }} | ||
``` | ||
### `docker-user` | ||
|
||
Specify a user (or user-id) to run docker command. | ||
|
||
You can use it with [`docker-cmd-file`](#docker-cmd-file) in order to start the | ||
image as root, do some customization and switch back to a unprivileged user. | ||
|
||
### `env-regex` | ||
|
||
Allows to configure the regex to define which environment variables are passed to the renovate container. | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
install-apt sl | ||
|
||
exec runuser -u ubuntu renovate |
This file contains 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
This file contains 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