You've already forked tarr
Compare commits
41 Commits
0.1.0
...
4fc514108d
Author | SHA1 | Date | |
---|---|---|---|
4fc514108d
|
|||
681e6726b1 | |||
72422e032d
|
|||
2f17abedb9
|
|||
d2cf678b97
|
|||
87918c2339
|
|||
7253c2ed5b
|
|||
8708af6a5a
|
|||
b525c82ccb
|
|||
d39989d224
|
|||
dfe4fd60cf
|
|||
d1e111fe0d
|
|||
f40cb5f965
|
|||
02d980440f
|
|||
7baa16a257
|
|||
df3192ab75
|
|||
b316124df4
|
|||
fe9a5278f7
|
|||
2e54fd12ee
|
|||
77135a002a
|
|||
e8fb97d1da
|
|||
1abe222e58
|
|||
e8db5cb23d
|
|||
3885d7b4e0
|
|||
9552a42935
|
|||
808754e2f1
|
|||
85db66baaa
|
|||
47f777b8f1
|
|||
030c5b19e6
|
|||
cbf926fdbd
|
|||
dce2f1a428
|
|||
0bf24d63c1
|
|||
ce12621dd1
|
|||
9f3f707457
|
|||
9e5772116a
|
|||
e31e10c7bb
|
|||
c16ed2d0ae
|
|||
7865d2e8d7
|
|||
fe63389623
|
|||
44d2ccb671
|
|||
e582266bbc
|
727
.drone.yml
727
.drone.yml
@ -1,727 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: kubernetes
|
|
||||||
name: linter
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: markdown lint
|
|
||||||
commands:
|
|
||||||
- markdownlint *.md
|
|
||||||
image: git.cryptic.systems/volker.raschek/markdownlint:0.41.0
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 150
|
|
||||||
memory: 150M
|
|
||||||
|
|
||||||
- name: email-notification
|
|
||||||
environment:
|
|
||||||
SMTP_FROM_ADDRESS:
|
|
||||||
from_secret: smtp_from_address
|
|
||||||
SMTP_FROM_NAME:
|
|
||||||
from_secret: smtp_from_name
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: smtp_host
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: smtp_username
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: smtp_password
|
|
||||||
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 150
|
|
||||||
memory: 150M
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
exclude:
|
|
||||||
- tag
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: unit-test-amd64
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
platform:
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: unit-test
|
|
||||||
commands:
|
|
||||||
- go test -v ./...
|
|
||||||
image: docker.io/library/golang:1.23.0
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
exclude:
|
|
||||||
- tag
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: unit-test-arm64
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
platform:
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: unit-test
|
|
||||||
commands:
|
|
||||||
- go test -v ./...
|
|
||||||
image: docker.io/library/golang:1.23.0
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
include:
|
|
||||||
- pull_request
|
|
||||||
- push
|
|
||||||
exclude:
|
|
||||||
- tag
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: dry-run-amd64
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- linter
|
|
||||||
- unit-test-amd64
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: docker.io/plugins/docker:20.18.3
|
|
||||||
settings:
|
|
||||||
auto_tag: false
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
dry_run: true
|
|
||||||
force_tag: true
|
|
||||||
no_cache: true
|
|
||||||
purge: true
|
|
||||||
mirror:
|
|
||||||
from_secret: docker_io_mirror
|
|
||||||
registry: git.cryptic.systems
|
|
||||||
repo: git.cryptic.systems/volker.raschek/tarr
|
|
||||||
tags: latest-amd64
|
|
||||||
username:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_user
|
|
||||||
password:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_password
|
|
||||||
|
|
||||||
- name: email-notification
|
|
||||||
environment:
|
|
||||||
SMTP_FROM_ADDRESS:
|
|
||||||
from_secret: smtp_from_address
|
|
||||||
SMTP_FROM_NAME:
|
|
||||||
from_secret: smtp_from_name
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: smtp_host
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: smtp_username
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: smtp_password
|
|
||||||
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
exclude:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
- pull_request
|
|
||||||
- push
|
|
||||||
repo:
|
|
||||||
- volker.raschek/tarr
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: dry-run-arm64-v8
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- linter
|
|
||||||
- unit-test-arm64
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: docker.io/plugins/docker:20.18.3
|
|
||||||
settings:
|
|
||||||
auto_tag: false
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
dry_run: true
|
|
||||||
force_tag: true
|
|
||||||
no_cache: true
|
|
||||||
purge: true
|
|
||||||
mirror:
|
|
||||||
from_secret: docker_io_mirror
|
|
||||||
registry: git.cryptic.systems
|
|
||||||
repo: git.cryptic.systems/volker.raschek/tarr
|
|
||||||
tags: latest-arm64-v8
|
|
||||||
username:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_user
|
|
||||||
password:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_password
|
|
||||||
|
|
||||||
- name: email-notification
|
|
||||||
environment:
|
|
||||||
SMTP_FROM_ADDRESS:
|
|
||||||
from_secret: smtp_from_address
|
|
||||||
SMTP_FROM_NAME:
|
|
||||||
from_secret: smtp_from_name
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: smtp_host
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: smtp_username
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: smtp_password
|
|
||||||
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
exclude:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
- pull_request
|
|
||||||
- push
|
|
||||||
repo:
|
|
||||||
- volker.raschek/tarr
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: latest-amd64
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- linter
|
|
||||||
- unit-test-amd64
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: docker.io/plugins/docker:20.18.3
|
|
||||||
settings:
|
|
||||||
auto_tag: false
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
force_tag: true
|
|
||||||
no_cache: true
|
|
||||||
purge: true
|
|
||||||
mirror:
|
|
||||||
from_secret: docker_io_mirror
|
|
||||||
registry: git.cryptic.systems
|
|
||||||
repo: git.cryptic.systems/volker.raschek/tarr
|
|
||||||
tags: latest-amd64
|
|
||||||
username:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_user
|
|
||||||
password:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_password
|
|
||||||
|
|
||||||
- name: email-notification
|
|
||||||
environment:
|
|
||||||
SMTP_FROM_ADDRESS:
|
|
||||||
from_secret: smtp_from_address
|
|
||||||
SMTP_FROM_NAME:
|
|
||||||
from_secret: smtp_from_name
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: smtp_host
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: smtp_username
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: smtp_password
|
|
||||||
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
- cron
|
|
||||||
- push
|
|
||||||
repo:
|
|
||||||
- volker.raschek/tarr
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: latest-arm64-v8
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- linter
|
|
||||||
- unit-test-arm64
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: docker.io/plugins/docker:20.18.3
|
|
||||||
settings:
|
|
||||||
auto_tag: false
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
force_tag: true
|
|
||||||
no_cache: true
|
|
||||||
purge: true
|
|
||||||
mirror:
|
|
||||||
from_secret: docker_io_mirror
|
|
||||||
registry: git.cryptic.systems
|
|
||||||
repo: git.cryptic.systems/volker.raschek/tarr
|
|
||||||
tags: latest-arm64-v8
|
|
||||||
username:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_user
|
|
||||||
password:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_password
|
|
||||||
|
|
||||||
- name: email-notification
|
|
||||||
environment:
|
|
||||||
SMTP_FROM_ADDRESS:
|
|
||||||
from_secret: smtp_from_address
|
|
||||||
SMTP_FROM_NAME:
|
|
||||||
from_secret: smtp_from_name
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: smtp_host
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: smtp_username
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: smtp_password
|
|
||||||
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
- cron
|
|
||||||
- push
|
|
||||||
repo:
|
|
||||||
- volker.raschek/tarr
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: kubernetes
|
|
||||||
name: latest-manifest
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- latest-amd64
|
|
||||||
- latest-arm64-v8
|
|
||||||
|
|
||||||
# docker.io/plugins/manifest only for amd64 architectures available
|
|
||||||
node_selector:
|
|
||||||
kubernetes.io/os: linux
|
|
||||||
kubernetes.io/arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: build-manifest
|
|
||||||
image: docker.io/plugins/manifest:1.4.0
|
|
||||||
settings:
|
|
||||||
auto_tag: false
|
|
||||||
ignore_missing: true
|
|
||||||
spec: manifest.tmpl
|
|
||||||
username:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_user
|
|
||||||
password:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_password
|
|
||||||
|
|
||||||
- name: email-notification
|
|
||||||
environment:
|
|
||||||
SMTP_FROM_ADDRESS:
|
|
||||||
from_secret: smtp_from_address
|
|
||||||
SMTP_FROM_NAME:
|
|
||||||
from_secret: smtp_from_name
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: smtp_host
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: smtp_username
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: smtp_password
|
|
||||||
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 150
|
|
||||||
memory: 150M
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
- cron
|
|
||||||
- push
|
|
||||||
repo:
|
|
||||||
- volker.raschek/tarr
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: kubernetes
|
|
||||||
name: latest-sync
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- latest-manifest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: latest-sync
|
|
||||||
commands:
|
|
||||||
- skopeo sync --all --src=docker --src-creds=$SRC_CRED_USERNAME:$SRC_CRED_PASSWORD --dest=docker --dest-creds=$DEST_CRED_USERNAME:$DEST_CRED_PASSWORD git.cryptic.systems/volker.raschek/tarr docker.io/volkerraschek
|
|
||||||
environment:
|
|
||||||
SRC_CRED_USERNAME:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_user
|
|
||||||
SRC_CRED_PASSWORD:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_password
|
|
||||||
DEST_CRED_USERNAME:
|
|
||||||
from_secret: container_image_registry_user
|
|
||||||
DEST_CRED_PASSWORD:
|
|
||||||
from_secret: container_image_registry_password
|
|
||||||
image: quay.io/skopeo/stable:v1.16.0
|
|
||||||
|
|
||||||
- name: email-notification
|
|
||||||
environment:
|
|
||||||
SMTP_FROM_ADDRESS:
|
|
||||||
from_secret: smtp_from_address
|
|
||||||
SMTP_FROM_NAME:
|
|
||||||
from_secret: smtp_from_name
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: smtp_host
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: smtp_username
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: smtp_password
|
|
||||||
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 150
|
|
||||||
memory: 150M
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
- cron
|
|
||||||
- push
|
|
||||||
repo:
|
|
||||||
- volker.raschek/tarr
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: tagged-amd64
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: docker.io/plugins/docker:20.18.3
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: amd64
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
force_tag: true
|
|
||||||
no_cache: true
|
|
||||||
purge: true
|
|
||||||
mirror:
|
|
||||||
from_secret: docker_io_mirror
|
|
||||||
registry: git.cryptic.systems
|
|
||||||
repo: git.cryptic.systems/volker.raschek/tarr
|
|
||||||
username:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_user
|
|
||||||
password:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_password
|
|
||||||
build_args:
|
|
||||||
- VERSION=${DRONE_TAG}
|
|
||||||
|
|
||||||
- name: email-notification
|
|
||||||
environment:
|
|
||||||
SMTP_FROM_ADDRESS:
|
|
||||||
from_secret: smtp_from_address
|
|
||||||
SMTP_FROM_NAME:
|
|
||||||
from_secret: smtp_from_name
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: smtp_host
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: smtp_username
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: smtp_password
|
|
||||||
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
repo:
|
|
||||||
- volker.raschek/tarr
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: tagged-arm64-v8
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: docker.io/plugins/docker:20.18.3
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm64-v8
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
force_tag: true
|
|
||||||
no_cache: true
|
|
||||||
purge: true
|
|
||||||
mirror:
|
|
||||||
from_secret: docker_io_mirror
|
|
||||||
registry: git.cryptic.systems
|
|
||||||
repo: git.cryptic.systems/volker.raschek/tarr
|
|
||||||
username:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_user
|
|
||||||
password:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_password
|
|
||||||
build_args:
|
|
||||||
- VERSION=${DRONE_TAG}
|
|
||||||
|
|
||||||
- name: email-notification
|
|
||||||
environment:
|
|
||||||
SMTP_FROM_ADDRESS:
|
|
||||||
from_secret: smtp_from_address
|
|
||||||
SMTP_FROM_NAME:
|
|
||||||
from_secret: smtp_from_name
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: smtp_host
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: smtp_username
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: smtp_password
|
|
||||||
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
repo:
|
|
||||||
- volker.raschek/tarr
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: kubernetes
|
|
||||||
name: tagged-manifest
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- tagged-amd64
|
|
||||||
- tagged-arm64-v8
|
|
||||||
|
|
||||||
# docker.io/plugins/manifest only for amd64 architectures available
|
|
||||||
node_selector:
|
|
||||||
kubernetes.io/os: linux
|
|
||||||
kubernetes.io/arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: build-manifest
|
|
||||||
image: docker.io/plugins/manifest:1.4.0
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
ignore_missing: true
|
|
||||||
spec: manifest.tmpl
|
|
||||||
username:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_user
|
|
||||||
password:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_password
|
|
||||||
|
|
||||||
- name: email-notification
|
|
||||||
environment:
|
|
||||||
SMTP_FROM_ADDRESS:
|
|
||||||
from_secret: smtp_from_address
|
|
||||||
SMTP_FROM_NAME:
|
|
||||||
from_secret: smtp_from_name
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: smtp_host
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: smtp_username
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: smtp_password
|
|
||||||
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 150
|
|
||||||
memory: 150M
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
repo:
|
|
||||||
- volker.raschek/tarr
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: kubernetes
|
|
||||||
name: tagged-sync
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- tagged-manifest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone
|
|
||||||
image: git.cryptic.systems/volker.raschek/git:1.3.1
|
|
||||||
|
|
||||||
- name: tagged-sync
|
|
||||||
commands:
|
|
||||||
- skopeo sync --all --src=docker --src-creds=$SRC_CRED_USERNAME:$SRC_CRED_PASSWORD --dest=docker --dest-creds=$DEST_CRED_USERNAME:$DEST_CRED_PASSWORD git.cryptic.systems/volker.raschek/tarr docker.io/volkerraschek
|
|
||||||
environment:
|
|
||||||
SRC_CRED_USERNAME:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_user
|
|
||||||
SRC_CRED_PASSWORD:
|
|
||||||
from_secret: git_cryptic_systems_container_registry_password
|
|
||||||
DEST_CRED_USERNAME:
|
|
||||||
from_secret: container_image_registry_user
|
|
||||||
DEST_CRED_PASSWORD:
|
|
||||||
from_secret: container_image_registry_password
|
|
||||||
image: quay.io/skopeo/stable:v1.16.0
|
|
||||||
|
|
||||||
- name: email-notification
|
|
||||||
environment:
|
|
||||||
SMTP_FROM_ADDRESS:
|
|
||||||
from_secret: smtp_from_address
|
|
||||||
SMTP_FROM_NAME:
|
|
||||||
from_secret: smtp_from_name
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: smtp_host
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: smtp_username
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: smtp_password
|
|
||||||
image: git.cryptic.systems/volker.raschek/drone-email:0.1.5
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 150
|
|
||||||
memory: 150M
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- changed
|
|
||||||
- failure
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
repo:
|
|
||||||
- volker.raschek/tarr
|
|
29
.gitea/workflows/golang-linters.yaml
Normal file
29
.gitea/workflows/golang-linters.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: "Lint Golang files"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [ "opened", "reopened", "synchronize" ]
|
||||||
|
push:
|
||||||
|
branches: [ '**' ]
|
||||||
|
tags-ignore: [ '**' ]
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
golangci:
|
||||||
|
name: "Run golang CI linter"
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go: [ stable ]
|
||||||
|
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4.3.0
|
||||||
|
- uses: actions/setup-go@v5.5.0
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go }}
|
||||||
|
- uses: golangci/golangci-lint-action@v8.0.0
|
||||||
|
with:
|
||||||
|
version: v2.3.0 # renovate: datasource=github-releases depName=golangci/golangci-lint
|
42
.gitea/workflows/golang-tests.yaml
Normal file
42
.gitea/workflows/golang-tests.yaml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# name: "Run Golang tests"
|
||||||
|
|
||||||
|
# on:
|
||||||
|
# pull_request:
|
||||||
|
# types: [ "opened", "reopened", "synchronize" ]
|
||||||
|
# push:
|
||||||
|
# branches: [ '**' ]
|
||||||
|
# tags-ignore: [ '**' ]
|
||||||
|
# workflow_dispatch: {}
|
||||||
|
|
||||||
|
# jobs:
|
||||||
|
# integration-test:
|
||||||
|
# name: "Run integration tests"
|
||||||
|
# runs-on: ${{ matrix.os }}
|
||||||
|
# strategy:
|
||||||
|
# matrix:
|
||||||
|
# go: [ stable ]
|
||||||
|
# os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v4.3.0
|
||||||
|
# - uses: actions/setup-go@v5.5.0
|
||||||
|
# with:
|
||||||
|
# go-version: ${{ matrix.go }}
|
||||||
|
# - env:
|
||||||
|
# GOPROXY: ${{ vars.GOPROXY }}
|
||||||
|
# run: make test/integration
|
||||||
|
|
||||||
|
# unit-test:
|
||||||
|
# name: "Run unit tests"
|
||||||
|
# runs-on: ${{ matrix.os }}
|
||||||
|
# strategy:
|
||||||
|
# matrix:
|
||||||
|
# go: [ stable ]
|
||||||
|
# os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v4.3.0
|
||||||
|
# - uses: actions/setup-go@v5.5.0
|
||||||
|
# with:
|
||||||
|
# go-version: ${{ matrix.go }}
|
||||||
|
# - env:
|
||||||
|
# GOPROXY: ${{ vars.GOPROXY }}
|
||||||
|
# run: make test/unit
|
19
.gitea/workflows/markdown-linters.yaml
Normal file
19
.gitea/workflows/markdown-linters.yaml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
name: "Lint Markdown files"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [ "opened", "reopened", "synchronize" ]
|
||||||
|
push:
|
||||||
|
branches: [ '*' ]
|
||||||
|
tags-ignore: [ '*' ]
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
markdown-lint:
|
||||||
|
name: "Run markdown linter"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4.3.0
|
||||||
|
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0
|
||||||
|
with:
|
||||||
|
globs: '**/*.md'
|
53
.gitea/workflows/release.yaml
Normal file
53
.gitea/workflows/release.yaml
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
name: "Release"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: [ '**' ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: "Release application"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4.3.0
|
||||||
|
- uses: docker/setup-qemu-action@v3.6.0
|
||||||
|
- uses: actions/setup-go@v5.5.0
|
||||||
|
with:
|
||||||
|
go-version: stable
|
||||||
|
- uses: docker/login-action@v3.5.0
|
||||||
|
with:
|
||||||
|
registry: git.cryptic.systems
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
|
||||||
|
- env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
|
||||||
|
GONOSUMDB: ${{ vars.GONOSUMDB }}
|
||||||
|
GOPROXY: ${{ vars.GOPROXY }}
|
||||||
|
uses: goreleaser/goreleaser-action@v6.3.0
|
||||||
|
with:
|
||||||
|
version: v2.11.2 # renovate: datasource=github-releases depName=goreleaser/goreleaser
|
||||||
|
args: release --clean
|
||||||
|
|
||||||
|
sync-to-hub-docker-io:
|
||||||
|
name: "Upload Images to docker.io"
|
||||||
|
needs:
|
||||||
|
- release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Copy images to docker.io
|
||||||
|
run: |
|
||||||
|
TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm')
|
||||||
|
|
||||||
|
apt-get update --yes
|
||||||
|
apt-get install --yes skopeo
|
||||||
|
skopeo copy \
|
||||||
|
--all \
|
||||||
|
--dest-password ${{ secrets.DOCKER_IO_PASSWORD }} \
|
||||||
|
--dest-username ${{ secrets.DOCKER_IO_USERNAME }} \
|
||||||
|
--src-password ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} \
|
||||||
|
--src-username volker.raschek \
|
||||||
|
docker://git.cryptic.systems/volker.raschek/tarr:${TAG} \
|
||||||
|
docker://docker.io/volkerraschek/tarr:${TAG}
|
20
.gitea/workflows/update-docker-hub-description.yaml
Normal file
20
.gitea/workflows/update-docker-hub-description.yaml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
name: Update Docker Hub Description
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ 'master' ]
|
||||||
|
paths: [ 'README.md' ]
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-description-on-hub-docker-io:
|
||||||
|
runs-on:
|
||||||
|
- ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4.3.0
|
||||||
|
- uses: peter-evans/dockerhub-description@v4.0.2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_IO_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_IO_PASSWORD }}
|
||||||
|
repository: volkerraschek/tarr
|
||||||
|
readme-filepath: README.md
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
|
dist
|
||||||
cmd/autharr/autharr
|
cmd/autharr/autharr
|
||||||
cmd/healarr/healarr
|
cmd/healarr/healarr
|
13
.golangci.yaml
Normal file
13
.golangci.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
version: "2"
|
||||||
|
linters:
|
||||||
|
default: standard
|
||||||
|
enable:
|
||||||
|
- errname
|
||||||
|
- gosec
|
||||||
|
|
||||||
|
exclusions:
|
||||||
|
rules: []
|
||||||
|
warn-unused: true
|
||||||
|
|
||||||
|
run:
|
||||||
|
tests: true
|
207
.goreleaser.yaml
Normal file
207
.goreleaser.yaml
Normal file
@ -0,0 +1,207 @@
|
|||||||
|
project_name: tarr
|
||||||
|
|
||||||
|
archives:
|
||||||
|
- builds:
|
||||||
|
- autharr
|
||||||
|
- healarr
|
||||||
|
formats: [ "tar.xz" ]
|
||||||
|
files:
|
||||||
|
- README.md
|
||||||
|
- LICENSE
|
||||||
|
|
||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod tidy
|
||||||
|
|
||||||
|
builds:
|
||||||
|
- id: autharr
|
||||||
|
main: cmd/autharr/main.go
|
||||||
|
binary: >-
|
||||||
|
autharr-
|
||||||
|
{{- .Version }}-
|
||||||
|
{{- .Os }}-
|
||||||
|
{{- if eq .Arch "amd64" }}amd64
|
||||||
|
{{- else if eq .Arch "amd64_v1" }}amd64
|
||||||
|
{{- else }}{{ .Arch }}{{ end }}
|
||||||
|
{{- if .Arm }}-{{ .Arm }}{{ end }}
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
- GONOSUMDB={{ .Env.GONOSUMDB }}
|
||||||
|
- GOPROXY={{ .Env.GOPROXY }}
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm
|
||||||
|
- arm64
|
||||||
|
- riscv64
|
||||||
|
goarm:
|
||||||
|
- "6"
|
||||||
|
- "7"
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X 'main.version={{ trimprefix .Tag "v" }}'
|
||||||
|
|
||||||
|
- id: healarr
|
||||||
|
main: cmd/healarr/main.go
|
||||||
|
binary: >-
|
||||||
|
healarr-
|
||||||
|
{{- .Version }}-
|
||||||
|
{{- .Os }}-
|
||||||
|
{{- if eq .Arch "amd64" }}amd64
|
||||||
|
{{- else if eq .Arch "amd64_v1" }}amd64
|
||||||
|
{{- else }}{{ .Arch }}{{ end }}
|
||||||
|
{{- if .Arm }}-{{ .Arm }}{{ end }}
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
- GONOSUMDB={{ .Env.GONOSUMDB }}
|
||||||
|
- GOPROXY={{ .Env.GOPROXY }}
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm
|
||||||
|
- arm64
|
||||||
|
goarm:
|
||||||
|
- "6"
|
||||||
|
- "7"
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X 'main.version={{ trimprefix .Tag "v" }}'
|
||||||
|
|
||||||
|
changelog:
|
||||||
|
filters:
|
||||||
|
exclude:
|
||||||
|
- '^chore'
|
||||||
|
- '^docs'
|
||||||
|
- '^test'
|
||||||
|
- Merge pull request
|
||||||
|
- Merge branch
|
||||||
|
- go mod tidy
|
||||||
|
format: "{{.SHA}}: {{.Message}} (@{{.AuthorUsername}})"
|
||||||
|
groups:
|
||||||
|
- title: Features
|
||||||
|
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
|
||||||
|
order: 0
|
||||||
|
- title: "Bug fixes"
|
||||||
|
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
|
||||||
|
order: 1
|
||||||
|
- title: Others
|
||||||
|
order: 999
|
||||||
|
sort: asc
|
||||||
|
use: git
|
||||||
|
|
||||||
|
dockers:
|
||||||
|
- build_flag_templates:
|
||||||
|
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
|
||||||
|
- --label=org.opencontainers.image.description={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.revision={{ .FullCommit }}
|
||||||
|
- --label=org.opencontainers.image.source={{ .GitURL }}
|
||||||
|
- --label=org.opencontainers.image.title={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
|
||||||
|
- --platform=linux/amd64
|
||||||
|
- --pull
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
goarch: amd64
|
||||||
|
goos: linux
|
||||||
|
image_templates:
|
||||||
|
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-amd64'
|
||||||
|
skip_push: false
|
||||||
|
use: buildx
|
||||||
|
|
||||||
|
- build_flag_templates:
|
||||||
|
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
|
||||||
|
- --label=org.opencontainers.image.description={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.revision={{ .FullCommit }}
|
||||||
|
- --label=org.opencontainers.image.source={{ .GitURL }}
|
||||||
|
- --label=org.opencontainers.image.title={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
|
||||||
|
- --platform=linux/arm/v6
|
||||||
|
- --pull
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
goarch: arm
|
||||||
|
goarm: "6"
|
||||||
|
goos: linux
|
||||||
|
image_templates:
|
||||||
|
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v6'
|
||||||
|
skip_push: false
|
||||||
|
use: buildx
|
||||||
|
|
||||||
|
- build_flag_templates:
|
||||||
|
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
|
||||||
|
- --label=org.opencontainers.image.description={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.revision={{ .FullCommit }}
|
||||||
|
- --label=org.opencontainers.image.source={{ .GitURL }}
|
||||||
|
- --label=org.opencontainers.image.title={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
|
||||||
|
- --platform=linux/arm/v7
|
||||||
|
- --pull
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
goarch: arm
|
||||||
|
goarm: "7"
|
||||||
|
goos: linux
|
||||||
|
image_templates:
|
||||||
|
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v7'
|
||||||
|
skip_push: false
|
||||||
|
use: buildx
|
||||||
|
|
||||||
|
- build_flag_templates:
|
||||||
|
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
|
||||||
|
- --label=org.opencontainers.image.description={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.revision={{ .FullCommit }}
|
||||||
|
- --label=org.opencontainers.image.source={{ .GitURL }}
|
||||||
|
- --label=org.opencontainers.image.title={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
|
||||||
|
- --platform=linux/arm64
|
||||||
|
- --pull
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
goarch: arm64
|
||||||
|
goos: linux
|
||||||
|
image_templates:
|
||||||
|
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm64'
|
||||||
|
skip_push: false
|
||||||
|
use: buildx
|
||||||
|
|
||||||
|
- build_flag_templates:
|
||||||
|
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
|
||||||
|
- --label=org.opencontainers.image.description={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.revision={{ .FullCommit }}
|
||||||
|
- --label=org.opencontainers.image.source={{ .GitURL }}
|
||||||
|
- --label=org.opencontainers.image.title={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
|
||||||
|
- --platform=linux/riscv64
|
||||||
|
- --pull
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
goarch: riscv64
|
||||||
|
goos: linux
|
||||||
|
image_templates:
|
||||||
|
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-riscv64'
|
||||||
|
skip_push: false
|
||||||
|
use: buildx
|
||||||
|
|
||||||
|
docker_manifests:
|
||||||
|
- name_template: 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}'
|
||||||
|
image_templates:
|
||||||
|
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-amd64'
|
||||||
|
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v6'
|
||||||
|
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v7'
|
||||||
|
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm64'
|
||||||
|
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-riscv64'
|
||||||
|
|
||||||
|
gitea_urls:
|
||||||
|
api: https://git.cryptic.systems/api/v1
|
||||||
|
download: https://git.cryptic.systems
|
||||||
|
|
||||||
|
version: 2
|
22
Dockerfile
22
Dockerfile
@ -1,20 +1,4 @@
|
|||||||
FROM docker.io/library/golang:1.23.0-alpine3.19 AS build
|
FROM scratch AS build
|
||||||
|
|
||||||
RUN apk add git make
|
COPY autharr-* /usr/bin/autharr
|
||||||
|
COPY healarr-* /usr/bin/healarr
|
||||||
WORKDIR /workspace
|
|
||||||
ADD ./ /workspace
|
|
||||||
|
|
||||||
RUN make -C cmd/autharr install \
|
|
||||||
DESTDIR=/cache \
|
|
||||||
PREFIX=/usr \
|
|
||||||
VERSION=${VERSION}
|
|
||||||
|
|
||||||
RUN make -C cmd/healarr install \
|
|
||||||
DESTDIR=/cache \
|
|
||||||
PREFIX=/usr \
|
|
||||||
VERSION=${VERSION}
|
|
||||||
|
|
||||||
FROM docker.io/library/alpine:3.20
|
|
||||||
|
|
||||||
COPY --from=build /cache /
|
|
||||||
|
13
README.md
13
README.md
@ -1,13 +1,12 @@
|
|||||||
# tarr
|
# tarr
|
||||||
|
|
||||||
[](https://drone.cryptic.systems/volker.raschek/tarr)
|
|
||||||
[](https://hub.docker.com/r/volkerraschek/tarr)
|
[](https://hub.docker.com/r/volkerraschek/tarr)
|
||||||
|
|
||||||
The tarr project contains small binaries / tools for interacting with *arr applications. The tools are helpful in a
|
The tarr project contains small binaries / tools for interacting with *arr applications. The tools are helpful in a
|
||||||
kubernetes environment to retrofit missing functions of the \*arr applications.
|
kubernetes environment to retrofit missing functions of the \*arr applications.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE] Instead of compiling the tarr applications by yourself, use the tarr container image instead. More described
|
||||||
> Instead of compiling the tarr applications by yourself, use the tarr container image instead. More described [below](#container-image).
|
> [below](#container-image).
|
||||||
|
|
||||||
## autharr
|
## autharr
|
||||||
|
|
||||||
@ -63,9 +62,9 @@ Healthy
|
|||||||
|
|
||||||
## container-image
|
## container-image
|
||||||
|
|
||||||
The container image `docker.io/volkerraschek/tarr` contains all tarr applications. The command below is an example to
|
The container image `git.cryptic.systems/volker.raschek/tarr` contains all tarr applications. The command below is an
|
||||||
start `autharr` of the container image `volkerraschek/tarr` via docker. `autharr` is watching for changes of the API
|
example to start `autharr` of the container image `volker.raschek/tarr` via docker. `autharr` is watching for changes of
|
||||||
token. Any change will be written to the standard output.
|
the API token. Any change will be written to the standard output.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Adapt the volume mount, if you want to write the token to file on the host system.
|
> Adapt the volume mount, if you want to write the token to file on the host system.
|
||||||
@ -74,6 +73,6 @@ token. Any change will be written to the standard output.
|
|||||||
$ docker run \
|
$ docker run \
|
||||||
--rm \
|
--rm \
|
||||||
--volume /etc/bazarr:/etc/bazarr:ro \
|
--volume /etc/bazarr:/etc/bazarr:ro \
|
||||||
docker.io/volkerraschek/tarr:latest \
|
git.cryptic.systems/volker.raschek/tarr:latest \
|
||||||
autharr --watch /etc/bazarr/config.yaml
|
autharr --watch /etc/bazarr/config.yaml
|
||||||
```
|
```
|
||||||
|
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
@ -26,7 +27,9 @@ autharr /etc/lidarr/config.xml`,
|
|||||||
}
|
}
|
||||||
rootCmd.Flags().Bool("watch", false, "Listens for changes to the configuration and writes the token continuously to the output")
|
rootCmd.Flags().Bool("watch", false, "Listens for changes to the configuration and writes the token continuously to the output")
|
||||||
|
|
||||||
rootCmd.Execute()
|
if err := rootCmd.Execute(); err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func runE(cmd *cobra.Command, args []string) error {
|
func runE(cmd *cobra.Command, args []string) error {
|
||||||
@ -84,10 +87,16 @@ func runWatch(cmd *cobra.Command, args []string) error {
|
|||||||
select {
|
select {
|
||||||
case <-cmd.Context().Done():
|
case <-cmd.Context().Done():
|
||||||
return nil
|
return nil
|
||||||
case err := <-errorChannel:
|
case err, open := <-errorChannel:
|
||||||
logrus.WithError(err).Errorln("Received from config watcher")
|
if !open {
|
||||||
|
return fmt.Errorf("error channel has been closed")
|
||||||
|
}
|
||||||
|
logrus.WithError(err).Errorln("received from config watcher")
|
||||||
case <-timer.C:
|
case <-timer.C:
|
||||||
writeConfig(cachedConfig, dest)
|
err = writeConfig(cachedConfig, dest)
|
||||||
|
if err != nil {
|
||||||
|
logrus.WithError(err).Errorln("failed to write config")
|
||||||
|
}
|
||||||
case config := <-configChannel:
|
case config := <-configChannel:
|
||||||
cachedConfig = config
|
cachedConfig = config
|
||||||
timer.Reset(waitFor)
|
timer.Reset(waitFor)
|
||||||
@ -105,18 +114,23 @@ func writeConfig(config *domain.Config, dest string) error {
|
|||||||
case len(dest) > 0:
|
case len(dest) > 0:
|
||||||
dirname := filepath.Dir(dest)
|
dirname := filepath.Dir(dest)
|
||||||
|
|
||||||
|
// #nosec G301
|
||||||
err := os.MkdirAll(dirname, 0755)
|
err := os.MkdirAll(dirname, 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #nosec G304
|
||||||
f, err := os.Create(dest)
|
f, err := os.Create(dest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer func() { _ = f.Close() }()
|
defer func() { _ = f.Close() }()
|
||||||
|
|
||||||
f.WriteString(config.API.Token)
|
_, err = f.WriteString(config.API.Token)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.cryptic.systems/volker.raschek/tarr/pkg/config"
|
"git.cryptic.systems/volker.raschek/tarr/pkg/config"
|
||||||
@ -95,7 +96,10 @@ healarr sonarr https://sonarr.example.com:8443 --api-token my-token`,
|
|||||||
rootCmd.PersistentFlags().Bool("insecure", false, "Trust insecure TLS certificates")
|
rootCmd.PersistentFlags().Bool("insecure", false, "Trust insecure TLS certificates")
|
||||||
rootCmd.PersistentFlags().Duration("timeout", time.Minute, "Timeout")
|
rootCmd.PersistentFlags().Duration("timeout", time.Minute, "Timeout")
|
||||||
|
|
||||||
rootCmd.Execute()
|
err := rootCmd.Execute()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func runBazarrE(cmd *cobra.Command, args []string) error {
|
func runBazarrE(cmd *cobra.Command, args []string) error {
|
||||||
@ -152,7 +156,7 @@ func runE(cmd *cobra.Command, args []string, queryKey string) error {
|
|||||||
|
|
||||||
switch {
|
switch {
|
||||||
case len(apiToken) <= 0 && len(configPath) <= 0:
|
case len(apiToken) <= 0 && len(configPath) <= 0:
|
||||||
return fmt.Errorf("At least --api-token oder --config must be defined")
|
return fmt.Errorf("at least --api-token oder --config must be defined")
|
||||||
case len(apiToken) > 0 && len(configPath) <= 0:
|
case len(apiToken) > 0 && len(configPath) <= 0:
|
||||||
err = health.NewReadinessProbe(args[0]).
|
err = health.NewReadinessProbe(args[0]).
|
||||||
QueryAdd(queryKey, apiToken).
|
QueryAdd(queryKey, apiToken).
|
||||||
@ -175,7 +179,7 @@ func runE(cmd *cobra.Command, args []string, queryKey string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("Neither --api-token nor --config can be used at the same time.")
|
return fmt.Errorf("neither --api-token nor --config can be used at the same time")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
10
go.mod
10
go.mod
@ -3,10 +3,10 @@ module git.cryptic.systems/volker.raschek/tarr
|
|||||||
go 1.22.6
|
go 1.22.6
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/fsnotify/fsnotify v1.7.0
|
github.com/fsnotify/fsnotify v1.9.0
|
||||||
github.com/sirupsen/logrus v1.9.3
|
github.com/sirupsen/logrus v1.9.3
|
||||||
github.com/spf13/cobra v1.8.1
|
github.com/spf13/cobra v1.9.1
|
||||||
github.com/stretchr/testify v1.9.0
|
github.com/stretchr/testify v1.10.0
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -14,6 +14,6 @@ require (
|
|||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.6 // indirect
|
||||||
golang.org/x/sys v0.4.0 // indirect
|
golang.org/x/sys v0.13.0 // indirect
|
||||||
)
|
)
|
||||||
|
22
go.sum
22
go.sum
@ -1,9 +1,9 @@
|
|||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
|
||||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
@ -11,17 +11,17 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
|||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||||
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
|
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
|
||||||
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
|
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
|
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
||||||
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
image: git.cryptic.systems/volker.raschek/tarr:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
|
|
||||||
{{#if build.tags}}
|
|
||||||
tags:
|
|
||||||
{{#each build.tags}}
|
|
||||||
- {{this}}
|
|
||||||
{{/each}}
|
|
||||||
- "latest"
|
|
||||||
{{/if}}
|
|
||||||
manifests:
|
|
||||||
-
|
|
||||||
image: git.cryptic.systems/volker.raschek/tarr:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}-amd64
|
|
||||||
platform:
|
|
||||||
architecture: amd64
|
|
||||||
os: linux
|
|
||||||
-
|
|
||||||
image: git.cryptic.systems/volker.raschek/tarr:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}-arm64-v8
|
|
||||||
platform:
|
|
||||||
architecture: arm64
|
|
||||||
os: linux
|
|
||||||
variant: v8
|
|
@ -46,11 +46,12 @@ type YAMLConfig struct {
|
|||||||
// Read reads the config struct from a file. The decoding format will be determined by the file extension like
|
// Read reads the config struct from a file. The decoding format will be determined by the file extension like
|
||||||
// `xml` or `yaml`.
|
// `xml` or `yaml`.
|
||||||
func ReadConfig(name string) (*domain.Config, error) {
|
func ReadConfig(name string) (*domain.Config, error) {
|
||||||
|
// #nosec G304
|
||||||
f, err := os.Open(name)
|
f, err := os.Open(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer func() { _ = f.Close() }()
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case strings.HasSuffix(name, "xml"):
|
case strings.HasSuffix(name, "xml"):
|
||||||
@ -58,7 +59,7 @@ func ReadConfig(name string) (*domain.Config, error) {
|
|||||||
case strings.HasSuffix(name, "yml") || strings.HasSuffix(name, "yaml"):
|
case strings.HasSuffix(name, "yml") || strings.HasSuffix(name, "yaml"):
|
||||||
return readYAMLConfig(f)
|
return readYAMLConfig(f)
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("Unsupported file extension")
|
return nil, fmt.Errorf("unsupported file extension")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,8 +98,8 @@ func readYAMLConfig(r io.Reader) (*domain.Config, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func WatchConfig(ctx context.Context, name string) (<-chan *domain.Config, <-chan error) {
|
func WatchConfig(ctx context.Context, name string) (<-chan *domain.Config, <-chan error) {
|
||||||
configChannel := make(chan *domain.Config, 0)
|
configChannel := make(chan *domain.Config)
|
||||||
errorChannel := make(chan error, 0)
|
errorChannel := make(chan error)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
wait := time.Second * 3
|
wait := time.Second * 3
|
||||||
@ -110,14 +111,18 @@ func WatchConfig(ctx context.Context, name string) (<-chan *domain.Config, <-cha
|
|||||||
errorChannel <- err
|
errorChannel <- err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
watcher.Add(name)
|
err = watcher.Add(name)
|
||||||
|
if err != nil {
|
||||||
|
errorChannel <- err
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
close(configChannel)
|
close(configChannel)
|
||||||
close(errorChannel)
|
close(errorChannel)
|
||||||
break
|
return
|
||||||
case event, open := <-watcher.Events:
|
case event, open := <-watcher.Events:
|
||||||
if !open {
|
if !open {
|
||||||
errorChannel <- fmt.Errorf("FSWatcher closed channel: %w", err)
|
errorChannel <- fmt.Errorf("FSWatcher closed channel: %w", err)
|
||||||
@ -145,11 +150,12 @@ func WatchConfig(ctx context.Context, name string) (<-chan *domain.Config, <-cha
|
|||||||
// WriteConfig writes the config struct into the file. The encoding format will be determined by the file extension like
|
// WriteConfig writes the config struct into the file. The encoding format will be determined by the file extension like
|
||||||
// `xml` or `yaml`.
|
// `xml` or `yaml`.
|
||||||
func WriteConfig(name string, config *domain.Config) error {
|
func WriteConfig(name string, config *domain.Config) error {
|
||||||
|
// #nosec G304
|
||||||
f, err := os.Create(name)
|
f, err := os.Create(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer func() { _ = f.Close() }()
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case strings.HasSuffix(name, "xml"):
|
case strings.HasSuffix(name, "xml"):
|
||||||
@ -157,13 +163,13 @@ func WriteConfig(name string, config *domain.Config) error {
|
|||||||
case strings.HasSuffix(name, "yml") || strings.HasSuffix(name, "yaml"):
|
case strings.HasSuffix(name, "yml") || strings.HasSuffix(name, "yaml"):
|
||||||
return writeYAMLConfig(f, config)
|
return writeYAMLConfig(f, config)
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("Unsupported file extension")
|
return fmt.Errorf("unsupported file extension")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeXMLConfig(w io.Writer, config *domain.Config) error {
|
func writeXMLConfig(w io.Writer, config *domain.Config) error {
|
||||||
xmlEncoder := xml.NewEncoder(w)
|
xmlEncoder := xml.NewEncoder(w)
|
||||||
defer xmlEncoder.Close()
|
defer func() { _ = xmlEncoder.Close() }()
|
||||||
|
|
||||||
xmlConfig := &XMLConfig{
|
xmlConfig := &XMLConfig{
|
||||||
APIToken: config.API.Token,
|
APIToken: config.API.Token,
|
||||||
@ -180,7 +186,7 @@ func writeXMLConfig(w io.Writer, config *domain.Config) error {
|
|||||||
|
|
||||||
func writeYAMLConfig(w io.Writer, config *domain.Config) error {
|
func writeYAMLConfig(w io.Writer, config *domain.Config) error {
|
||||||
yamlEncoder := yaml.NewEncoder(w)
|
yamlEncoder := yaml.NewEncoder(w)
|
||||||
defer yamlEncoder.Close()
|
defer func() { _ = yamlEncoder.Close() }()
|
||||||
|
|
||||||
yamlConfig := &YAMLConfig{
|
yamlConfig := &YAMLConfig{
|
||||||
Auth: YAMLConfigAuth{
|
Auth: YAMLConfigAuth{
|
||||||
|
@ -24,6 +24,7 @@ func TestReadWriteConfig_XML(t *testing.T) {
|
|||||||
t.Cleanup(func() { _ = os.RemoveAll(tmpDir) })
|
t.Cleanup(func() { _ = os.RemoveAll(tmpDir) })
|
||||||
|
|
||||||
expectedXMLConfigName := filepath.Join(tmpDir, "expected_config.xml")
|
expectedXMLConfigName := filepath.Join(tmpDir, "expected_config.xml")
|
||||||
|
// #nosec G304
|
||||||
f, err := os.Create(expectedXMLConfigName)
|
f, err := os.Create(expectedXMLConfigName)
|
||||||
require.NoError(err)
|
require.NoError(err)
|
||||||
|
|
||||||
@ -38,6 +39,7 @@ func TestReadWriteConfig_XML(t *testing.T) {
|
|||||||
err = config.WriteConfig(actualXMLConfigName, actualConfig)
|
err = config.WriteConfig(actualXMLConfigName, actualConfig)
|
||||||
require.NoError(err)
|
require.NoError(err)
|
||||||
|
|
||||||
|
// #nosec G304
|
||||||
b, err := os.ReadFile(actualXMLConfigName)
|
b, err := os.ReadFile(actualXMLConfigName)
|
||||||
require.NoError(err)
|
require.NoError(err)
|
||||||
require.Equal(expectedXMLConfig, string(b))
|
require.Equal(expectedXMLConfig, string(b))
|
||||||
@ -51,6 +53,7 @@ func TestReadWriteConfig_YAML(t *testing.T) {
|
|||||||
t.Cleanup(func() { _ = os.RemoveAll(tmpDir) })
|
t.Cleanup(func() { _ = os.RemoveAll(tmpDir) })
|
||||||
|
|
||||||
expectedYAMLConfigName := filepath.Join(tmpDir, "expected_config.yaml")
|
expectedYAMLConfigName := filepath.Join(tmpDir, "expected_config.yaml")
|
||||||
|
// #nosec G304
|
||||||
f, err := os.Create(expectedYAMLConfigName)
|
f, err := os.Create(expectedYAMLConfigName)
|
||||||
require.NoError(err)
|
require.NoError(err)
|
||||||
|
|
||||||
@ -65,6 +68,7 @@ func TestReadWriteConfig_YAML(t *testing.T) {
|
|||||||
err = config.WriteConfig(actualYAMLConfigName, actualConfig)
|
err = config.WriteConfig(actualYAMLConfigName, actualConfig)
|
||||||
require.NoError(err)
|
require.NoError(err)
|
||||||
|
|
||||||
|
// #nosec G304
|
||||||
b, err := os.ReadFile(actualYAMLConfigName)
|
b, err := os.ReadFile(actualYAMLConfigName)
|
||||||
require.NoError(err)
|
require.NoError(err)
|
||||||
require.Equal(expectedYAMLConfig, string(b))
|
require.Equal(expectedYAMLConfig, string(b))
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrNoAPIToken error = errors.New("No API token defined")
|
var ErrNoAPIToken error = errors.New("no API token defined")
|
||||||
var ErrNoURL error = errors.New("No API token defined")
|
var ErrNoURL error = errors.New("no API token defined")
|
||||||
|
|
||||||
type ReadinessProbe struct {
|
type ReadinessProbe struct {
|
||||||
additionalQueryValues url.Values
|
additionalQueryValues url.Values
|
||||||
@ -40,6 +40,7 @@ func (rp *ReadinessProbe) Run(ctx context.Context) error {
|
|||||||
httpClient := &http.Client{
|
httpClient := &http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
TLSClientConfig: &tls.Config{
|
TLSClientConfig: &tls.Config{
|
||||||
|
// #nosec G402
|
||||||
InsecureSkipVerify: rp.insecure,
|
InsecureSkipVerify: rp.insecure,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -64,7 +65,7 @@ func (rp *ReadinessProbe) Run(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
return fmt.Errorf("Received unexpected HTTP status code %v", resp.StatusCode)
|
return fmt.Errorf("received unexpected HTTP status code %v", resp.StatusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -1,61 +1,10 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"assignees": [
|
"extends": [
|
||||||
"volker.raschek"
|
"local>volker.raschek/renovate-config:default#master",
|
||||||
],
|
"local>volker.raschek/renovate-config:container#master",
|
||||||
"customManagers": [
|
"local>volker.raschek/renovate-config:actions#master",
|
||||||
{
|
"local>volker.raschek/renovate-config:golang#master",
|
||||||
"customType": "regex",
|
"local>volker.raschek/renovate-config:regexp#master"
|
||||||
"description": "Update container-images in shell scripts",
|
|
||||||
"fileMatch": [
|
|
||||||
"./Makefile"
|
|
||||||
],
|
|
||||||
"matchStrings": [
|
|
||||||
"^[^\\s]*VERSION(:|\\?)?=\"?(?<currentValue>[\\w.]*)\"? # renovate: datasource=(?<datasource>[^\\s]*)( registryUrl=(?<registryUrl>[^\\s]*))? depName=(?<depName>[^\\s]*)"
|
|
||||||
]
|
]
|
||||||
}
|
|
||||||
],
|
|
||||||
"labels": [
|
|
||||||
"renovate"
|
|
||||||
],
|
|
||||||
"packageRules": [
|
|
||||||
{
|
|
||||||
"addLabels": [
|
|
||||||
"renovate/automerge",
|
|
||||||
"renovate/container-image"
|
|
||||||
],
|
|
||||||
"automerge": true,
|
|
||||||
"description": "Automatically update grouped public docker dependencies",
|
|
||||||
"enabled": true,
|
|
||||||
"groupName": "public container images",
|
|
||||||
"groupSlug": "public-container-images",
|
|
||||||
"matchDatasources": [
|
|
||||||
"docker"
|
|
||||||
],
|
|
||||||
"matchUpdateTypes": [
|
|
||||||
"minor",
|
|
||||||
"patch"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"description": "Automatically update patch versions of go modules",
|
|
||||||
"addLabels": [
|
|
||||||
"renovate/gomod"
|
|
||||||
],
|
|
||||||
"automerge": true,
|
|
||||||
"matchManagers": [
|
|
||||||
"gomod"
|
|
||||||
],
|
|
||||||
"matchUpdateTypes": [
|
|
||||||
"minor",
|
|
||||||
"patch"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"postUpdateOptions": [
|
|
||||||
"gomodTidy"
|
|
||||||
],
|
|
||||||
"rebaseLabel": "renovate/rebase",
|
|
||||||
"rebaseWhen": "behind-base-branch",
|
|
||||||
"rollbackPrs": true
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user