From 2538b016d48d9fa96174d33c2ec6fce715403d3d Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 27 May 2022 15:31:58 +0200 Subject: [PATCH] add 'bin/renovatepls' + explainer --- README.md | 9 +++++++++ bin/renovatepls | 26 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 bin/renovatepls diff --git a/README.md b/README.md index c69d37f..9f48867 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,12 @@ this repo holds configuration files for `dotya.ml`-operated [`renovate`](https://github.com/renovatebot/renovate) [bot](https://git.dotya.ml/renovate-bot). + +### usage +fill (or otherwise provide to the process) desired environment variables and +run `bin/renovatepls` regularly (ideally with `cron` or using a `systemd` +timer). + +`renovatepls` is just a simple bash script that does just that: sets some env +vars (might need to modify them, e.g. for using with your own instance of +Gitea...) and then executes `renovate`. diff --git a/bin/renovatepls b/bin/renovatepls new file mode 100755 index 0000000..bf15c57 --- /dev/null +++ b/bin/renovatepls @@ -0,0 +1,26 @@ +#!/bin/bash + +# export env vars and run renovate + +export RENOVATE_CONFIG_FILE="/etc/renovate-bot/config.js" +# Gitea access token for Renovate Bot user +export RENOVATE_TOKEN="${RENOVATE_TOKEN}" +# token for GitHub release notes to avoid getting rate-limited +export GITHUB_COM_TOKEN="${GITHUB_COM_TOKEN}" +# this email address doesn't exist but to git it doesn't matter +export RENOVATE_GIT_AUTHOR='Renovate Bot ' +export RENOVATE_HOST_RULES="[{\"hostType\": \"github\", \"domainName\": \"github.com\", \"token\": \"${GITHUB_COM_TOKEN}\"}]" +export RENOVATE_DOCKER_USER="${RENOVATE_DOCKER_USER_AND_GROUP}" + +# used as the git signing key only to sign commits/tags +GPG_KEY="$(gpg --armor --export-secret-keys "${SIGNING_KEY}")" + +export RENOVATE_GIT_PRIVATE_KEY="${GPG_KEY}" +# enable custom (i.e. self-hosted) rust crate registries +export RENOVATE_ALLOW_CUSTOM_CRATE_REGISTRIES=true +# modify the PR footer to something that makes more sense for a self-hosted +# instance of renovate +export RENOVATE_PR_FOOTER="This PR has been generated by [Renovate Bot](https://git.dotya.ml/dotya.ml/renovate-bot)." + +# do renovate +renovate --host-rules="$RENOVATE_HOST_RULES"