Install renovate

It doesn't quite work, as really it needs docker to correctly update packages. But it's a start for now
This commit is contained in:
Jake Howard 2022-01-01 18:23:32 +00:00
parent b81f250d02
commit 78b0161585
Signed by: jake
GPG Key ID: 57AFB45680EDD477
8 changed files with 101 additions and 0 deletions

View File

@ -56,6 +56,7 @@
- pve_nebula_route
- privatebin
- vaultwarden
- renovate
- hosts: ingress
roles:

View File

@ -0,0 +1,11 @@
module.exports = {
endpoint: 'https://git.theorangeone.net/api/v4/',
token: '{{ renovate_gitlab_token }}',
platform: 'gitlab',
//dryRun: true,
autodiscover: true,
onboarding: false,
redisUrl: 'redis://redis',
repositoryCache: 'enabled',
persistRepoData: true
};

View File

@ -0,0 +1,23 @@
version: "2.3"
services:
renovate:
image: renovate/renovate:31-slim
user: "{{ docker_user.id }}"
command: /entrypoint.sh
environment:
- TZ={{ TZ }}
- GITHUB_COM_TOKEN={{ renovate_github_token }}
restart: unless-stopped
depends_on:
- redis
tmpfs:
- /tmp
volumes:
- "{{ app_data_dir }}/renovate/config.js:/usr/src/app/config.js:ro"
- "{{ app_data_dir }}/renovate/entrypoint.sh:/entrypoint.sh:ro"
redis:
image: redis:6-alpine
restart: unless-stopped
volumes:
- /mnt/tank/dbs/redis/renovate:/data

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e
while true;
do
renovate $@
echo "> Sleeping for 1 hour..."
sleep 1h &
wait $!
done

View File

@ -0,0 +1,4 @@
- name: restart renovate
shell:
chdir: /opt/renovate
cmd: "{{ docker_update_command }}"

View File

@ -0,0 +1,38 @@
- name: Include vault
include_vars: vault.yml
- name: Create install directory
file:
path: /opt/renovate
state: directory
owner: "{{ docker_user.name }}"
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Install compose file
template:
src: files/docker-compose.yml
dest: /opt/renovate/docker-compose.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
validate: docker-compose -f %s config
notify: restart renovate
become: true
- name: Install config file
template:
src: files/config.js
dest: "{{ app_data_dir }}/renovate/config.js"
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
notify: restart renovate
become: true
- name: Install custom entrypoint
template:
src: files/entrypoint.sh
dest: "{{ app_data_dir }}/renovate/entrypoint.sh"
mode: "0755"
owner: "{{ docker_user.name }}"
notify: restart renovate
become: true

View File

@ -0,0 +1,2 @@
renovate_gitlab_token: "{{ vault_renovate_gitlab_token }}"
renovate_github_token: "{{ vault_renovate_github_token }}"

View File

@ -0,0 +1,11 @@
$ANSIBLE_VAULT;1.1;AES256
37666339323131376463616330376335623238363930353938383162623162633665623763626464
3833623739633363616362643166393538386139373139310a393530323937373938346237633536
32376237386536633134613438383730323565356164313933376232343866303764643033396237
6133313835663637660a336162303239636137313339366330323463326339366537343164663336
61346434383164336138626261663939333265306430316535653062393431646230636162373665
39386436306534316632376238616332636265303534316366356139303865323631323064303665
64636565666231643330396164383066623166393339633330363633343639346637343239313936
37613266393438616166326138313262623837386231393666633361396364313335346238313863
65383435626335333631326537373366636439306366373235386132393839663063333063383133
6333613165306462376631326239613864613630363738633331