From bfd6833474deea9206e1bd6527905548911b9b31 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Oct 2023 14:34:55 +0200 Subject: [PATCH] Update linuxserver/jackett Docker tag to v0.21.1084 (#62) * 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 --- charts/jackett/Chart.yaml | 4 +- charts/jackett/values.yaml | 2 +- hack/update_after_renovate.go | 80 +++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 hack/update_after_renovate.go diff --git a/charts/jackett/Chart.yaml b/charts/jackett/Chart.yaml index 871aea9..fbf0210 100644 --- a/charts/jackett/Chart.yaml +++ b/charts/jackett/Chart.yaml @@ -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 diff --git a/charts/jackett/values.yaml b/charts/jackett/values.yaml index 0c7aa24..b6bfae4 100644 --- a/charts/jackett/values.yaml +++ b/charts/jackett/values.yaml @@ -24,7 +24,7 @@ common: isPrivate: false secretName: null repository: linuxserver/jackett - tag: 0.21.709 + tag: 0.21.1084 pullPolicy: Always # ingress diff --git a/hack/update_after_renovate.go b/hack/update_after_renovate.go new file mode 100644 index 0000000..2a11de8 --- /dev/null +++ b/hack/update_after_renovate.go @@ -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) +}