Compare commits
5 Commits
617166ae00
...
docs/motiv
| Author | SHA1 | Date | |
|---|---|---|---|
|
4c095d62e3
|
|||
|
047f830b58
|
|||
|
|
80fe79d369 | ||
|
005433abee
|
|||
|
9db86258fd
|
29
CHANGELOG.md
Normal file
29
CHANGELOG.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Changelog
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.1.0] - 2023-08-08
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- add basic ci
|
||||||
|
- add basic readme
|
||||||
|
- with main loop
|
||||||
|
- with initial cmd and server
|
||||||
|
|
||||||
|
### Docs
|
||||||
|
- *(README)* added some more milestones and fixed docker-compose
|
||||||
|
- add clarification about expectations and what milestones are missing
|
||||||
|
- add license
|
||||||
|
- clarification
|
||||||
|
|
||||||
|
### Other
|
||||||
|
- Merge pull request 'Configure Renovate' (#1) from renovate/configure into main
|
||||||
|
|
||||||
|
Reviewed-on: https://git.front.kjuulh.io/kjuulh/contractor/pulls/1
|
||||||
|
|
||||||
|
- Add renovate.json
|
||||||
|
|
||||||
107
README.md
107
README.md
@@ -1,21 +1,64 @@
|
|||||||
# Contractor - A renovate bot for gitea and github
|
# Contractor - A renovate bot for gitea and github
|
||||||
|
|
||||||
Contractor is a chatops like bot, integrating with github/gitea issues, allowing commands to trigger renovate runs.
|
Contractor is a chatops like bot, integrating with github/gitea issues, allowing
|
||||||
|
commands to trigger renovate runs.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
/contractor refresh
|
/contractor refresh
|
||||||
```
|
```
|
||||||
|
|
||||||
Contractor runs in a regular docker image and uses the official renovate slim image behind the scenes, this can be changed in the configuration.
|
Contractor runs in a regular docker image and uses the official renovate slim
|
||||||
|
image behind the scenes, this can be changed in the configuration.
|
||||||
|
|
||||||

|

|
||||||
<small>Do note that the contractor was run under a personal user, hence the same user replied</small>
|
<small>Do note that the contractor was run under a personal user, hence the same
|
||||||
|
user replied</small>
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
Renovate by default if hosted yourself, is neither sharded, or runs on a
|
||||||
|
cron-job cycle. This leaves a lot to be desired from a developers point of view.
|
||||||
|
As it may take quite a long time for renovate to revisit the pull-request again,
|
||||||
|
if there is a lot of repositories enabled.
|
||||||
|
|
||||||
|
This project intends to add an ad-hoc invocation of renovate for a single
|
||||||
|
repository, this enables developers to retrigger renovate whenever they want.
|
||||||
|
|
||||||
|
The project is built to be integrated with github and gitea (initially), and
|
||||||
|
work in its pull-request system, so when a renovate pr shows up, you can either
|
||||||
|
manually retrigger it, or enable any of the options in the renovate dashboard,
|
||||||
|
and retrigger.
|
||||||
|
|
||||||
|
## DISCLAIMER
|
||||||
|
|
||||||
|
The project is still 0.x.x As such the api is subject to change, and the
|
||||||
|
examples will probably be out of date. The below should be seen as an example of
|
||||||
|
what the project will look like once feature-complete.
|
||||||
|
|
||||||
|
## Milestones
|
||||||
|
|
||||||
|
- [x] 0.1.0
|
||||||
|
- Includes basic setup such as working server bot, and installation command,
|
||||||
|
automation is missing however. Also only gitea support for now, because this
|
||||||
|
is where the project initially is supposed to be in use.
|
||||||
|
- [ ] 0.2.0
|
||||||
|
- Add GitHub support
|
||||||
|
- [ ] 0.3.0
|
||||||
|
- Add Delegation support (not clustering, just delegation of renovate jobs)
|
||||||
|
- [ ] 0.4.0
|
||||||
|
- Slack integration
|
||||||
|
- [ ] 0.5.0
|
||||||
|
- GitHub App and such support
|
||||||
|
- [ ] 0.6.0
|
||||||
|
- Add api key support
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
First you need to pull and run the contractor image, docker is the preferred way of execution, but golang is also available from source.
|
First you need to pull and run the contractor image, docker is the preferred way
|
||||||
|
of execution, but golang is also available from source.
|
||||||
|
|
||||||
Docker compose is given as an example, but you're free to run using `docker run` if you prefer.
|
Docker compose is given as an example, but you're free to run using `docker run`
|
||||||
|
if you prefer.
|
||||||
|
|
||||||
See example for a ready-to-run image
|
See example for a ready-to-run image
|
||||||
|
|
||||||
@@ -24,18 +67,17 @@ See example for a ready-to-run image
|
|||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
contractor:
|
contractor:
|
||||||
image: docker.io/kjuulh/contractor:latest
|
image: docker.io/kjuulh/contractor:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
commands:
|
commands:
|
||||||
- contractor server serve
|
- contractor server serve
|
||||||
volumes:
|
volumes:
|
||||||
- "./templates/contractor:/mnt/config"
|
- "./templates/contractor:/mnt/config"
|
||||||
- "/var/run/docker.sock:/var/run/docker.sock"
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# file: .env
|
# file: .env
|
||||||
GITEA_RENOVATE_TOKEN=<gitea application token> # needs repo and pull request permissions
|
GITEA_RENOVATE_TOKEN=<gitea application token> # needs repo and pull request permissions
|
||||||
@@ -57,28 +99,37 @@ CONTRACTOR_API_KEY='<some sufficiently secret password used for webhooks to auth
|
|||||||
// Remember to fill out the options as you see fit, this is not a complete example
|
// Remember to fill out the options as you see fit, this is not a complete example
|
||||||
```
|
```
|
||||||
|
|
||||||
Use renovate secret for each `{{ secrets.HARBOR_SERVER_PASSWORD }}` in your config, replace `HARBOR_SERVER_PASSWORD` with your own
|
Use renovate secret for each `{{ secrets.HARBOR_SERVER_PASSWORD }}` in your
|
||||||
|
config, replace `HARBOR_SERVER_PASSWORD` with your own
|
||||||
|
|
||||||
And then run the server with: `docker compose up`
|
And then run the server with: `docker compose up`
|
||||||
|
|
||||||
This has started the server, but github doesn't know that it needs to talk to you yet.
|
This has started the server, but github doesn't know that it needs to talk to
|
||||||
|
you yet.
|
||||||
|
|
||||||
As such host the server somewhere with a public hostname, such that github or gitea webhooks can reach it, i.e. contractor.some-domain.com:9111
|
As such host the server somewhere with a public hostname, such that github or
|
||||||
|
gitea webhooks can reach it, i.e. contractor.some-domain.com:9111
|
||||||
|
|
||||||
To install the webhook, either use the docker image, or download the cli from source.
|
To install the webhook, either use the docker image, or download the cli from
|
||||||
|
source.
|
||||||
|
|
||||||
### CLI
|
### CLI
|
||||||
|
|
||||||
To install the cli
|
To install the cli
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go install git.front.kjuulh.io/kjuulh/contractor@latest
|
go install git.front.kjuulh.io/kjuulh/contractor@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
contractor will automatically read any .env file, so you can leave out the secrets.
|
contractor will automatically read any .env file, so you can leave out the
|
||||||
|
secrets.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
contractor install --owner kjuulh --repository contractor --url https://git.front.kjuulh.io/api/v1 --backend gitea
|
contractor install \
|
||||||
|
--owner kjuulh \
|
||||||
|
--repository contractor \
|
||||||
|
--url https://git.front.kjuulh.io/api/v1 \
|
||||||
|
--backend gitea
|
||||||
```
|
```
|
||||||
|
|
||||||
If you leave any of these out, contractor will prompt your for required values.
|
If you leave any of these out, contractor will prompt your for required values.
|
||||||
@@ -88,9 +139,15 @@ If you leave any of these out, contractor will prompt your for required values.
|
|||||||
You can also use docker for it.
|
You can also use docker for it.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose run contractor install --owner kjuulh --repository contractor --url https://git.front.kjuulh.io/api/v1 --backend gitea
|
docker compose run contractor \
|
||||||
|
install \
|
||||||
|
--owner kjuulh \
|
||||||
|
--repository contractor \
|
||||||
|
--url https://git.front.kjuulh.io/api/v1 \
|
||||||
|
--backend gitea
|
||||||
```
|
```
|
||||||
|
|
||||||
### GitHub App
|
### GitHub App
|
||||||
|
|
||||||
TBD, this should automatically install the webhook for allowed repositories, I just haven't gotten around to it yet. It is on the 0.3.0 Roadmap.
|
TBD, this should automatically install the webhook for allowed repositories, I
|
||||||
|
just haven't gotten around to it yet. It is on the 0.3.0 Roadmap.
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ mod please_release {
|
|||||||
) -> eyre::Result<()> {
|
) -> eyre::Result<()> {
|
||||||
let build_image = client
|
let build_image = client
|
||||||
.container()
|
.container()
|
||||||
.from("kasperhermansen/cuddle-please:main-1691463075");
|
.from("kasperhermansen/cuddle-please:main-1691504183");
|
||||||
|
|
||||||
let src = client
|
let src = client
|
||||||
.git_opts(
|
.git_opts(
|
||||||
|
|||||||
Reference in New Issue
Block a user