Skip to content

Commit

Permalink
Update linuxserver/jackett Docker tag to v0.21.1084 (#62)
Browse files Browse the repository at this point in the history
* Update linuxserver/jackett Docker tag to v0.21.1084

* Adding simple golang script to generate sed + commit message

* jackett: update version to match docker image tag

* Adding 'git add'

* jackett: update version to match docker image tag

* Increment version number

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qjoly <[email protected]>
  • Loading branch information
renovate[bot] and KubaBot authored Oct 26, 2023
1 parent 894f533 commit bfd6833
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 3 deletions.
4 changes: 2 additions & 2 deletions charts/jackett/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ apiVersion: v2
type: application
name: jackett
description: "Jackett works as a proxy server: it translates queries from apps into tracker-site-specific http queries."
version: 1.1.11
appVersion: "0.21.709"
version: 1.1.12
appVersion: "0.21.1084"
icon: https://raw.githubusercontent.com/RubxKube/charts/main/img/jackett-logo.png
maintainers:
- name: QJOLY
Expand Down
2 changes: 1 addition & 1 deletion charts/jackett/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ common:
isPrivate: false
secretName: null
repository: linuxserver/jackett
tag: 0.21.709
tag: 0.21.1084
pullPolicy: Always

# ingress
Expand Down
80 changes: 80 additions & 0 deletions hack/update_after_renovate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package main

import (
"fmt"
"log"
"os"
"strconv"
"strings"

dig_yaml "github.com/esakat/dig-yaml"
"gopkg.in/yaml.v2"
)

func main() {

var chartName = os.Getenv("CHART")

chartPath := fmt.Sprintf("charts/%s/Chart.yaml", chartName)
valuePath := fmt.Sprintf("charts/%s/values.yaml", chartName)

f, err := os.Open(chartPath)
defer f.Close()
if err != nil {
log.Fatal(err)
}

dec := yaml.NewDecoder(f)
var y map[interface{}]interface{}
dec.Decode(&y)

chartVersion, err := dig_yaml.DigYaml(y, "appVersion")
if err != nil {
log.Fatal(err)
}

chartRelease, err := dig_yaml.DigYaml(y, "version")
if err != nil {
log.Fatal(err)
}

f, err = os.Open(valuePath)
defer f.Close()
if err != nil {
log.Fatal(err)
}

dec = yaml.NewDecoder(f)
dec.Decode(&y)

appVersion, err2 := dig_yaml.DigYaml(y, "common", "image", "tag")
if err2 != nil {
log.Fatal(err2)
}

if appVersion != chartVersion {
fmt.Printf("✖️ Versions in 'Chart.yaml'(%s) and 'values.yaml'(%s) are differents.\n", chartVersion, appVersion)
} else {
fmt.Println("✔️ Versions are identicals.")
os.Exit(0)
}

v := strings.Split(chartRelease.(string), ".")
x, _ := strconv.ParseInt((v[len(v)-1]), 10, 0)
x += 1
v = v[:len(v)-1]
v = append(v, fmt.Sprint("", x))

newChartRelease := strings.Join(v, ".")

var sedHelp = fmt.Sprintf(`
If you want to replace the version in Chart.yaml file, please execute this command:
sed -i 's/%s/%s/' -i %s
sed -i 's/%s/%s/' -i %s
git add %s
git commit -m "%s: update version to match docker image tag"
`, chartVersion, appVersion, chartPath, chartRelease, newChartRelease, chartPath, chartPath, chartName)

fmt.Println(sedHelp)
}

0 comments on commit bfd6833

Please sign in to comment.