From b574a71e3b2d220c7bb4d77450905d057d4a6409 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Thu, 31 Oct 2024 19:08:54 +0000 Subject: [PATCH] Renovate for LTS version update --- .github/renovate.json | 14 +++++ .github/workflows/updatecli-action.yaml | 36 ------------ updatecli/current-jenkins.ps1 | 7 --- updatecli/update-jenkins.ps1 | 32 ----------- .../update-integrations-jenkins.yaml | 56 ------------------- updatecli/values.yaml | 8 --- 6 files changed, 14 insertions(+), 139 deletions(-) delete mode 100644 .github/workflows/updatecli-action.yaml delete mode 100644 updatecli/current-jenkins.ps1 delete mode 100644 updatecli/update-jenkins.ps1 delete mode 100644 updatecli/updatecli.d/update-integrations-jenkins.yaml delete mode 100644 updatecli/values.yaml diff --git a/.github/renovate.json b/.github/renovate.json index 3febbc003f..fffa73e998 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -9,5 +9,19 @@ "labels": [ "dependencies" ], + "customManagers": [ + { + "customType": "regex", + "fileMatch": [ + "integrations/pom.xml" + ], + "matchStrings": [ + "(?.*?)" + ], + "allowedVersions": "/^[0-9]+\\.[0-9]+\\.[0-9]+$/", + "depNameTemplate": "org.jenkins-ci.main:jenkins-war", + "datasourceTemplate": "maven" + } + ], "rebaseWhen": "conflicted" } diff --git a/.github/workflows/updatecli-action.yaml b/.github/workflows/updatecli-action.yaml deleted file mode 100644 index d317802a6b..0000000000 --- a/.github/workflows/updatecli-action.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: updatecli - -on: - workflow_dispatch: - pull_request: - push: - branches: - - master - schedule: - # * is a special character in YAML so you have to quote this string - # Run once a day - - cron: '0 0 * * *' - -jobs: - updatecli: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install updatecli - uses: updatecli/updatecli-action@v2 - - - name: Diff - continue-on-error: true - run: | - updatecli diff --config updatecli/updatecli.d --values updatecli/values.yaml - env: - UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Apply - if: github.ref == 'refs/heads/master' - run: | - updatecli apply --config updatecli/updatecli.d --values updatecli/values.yaml - env: - UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/updatecli/current-jenkins.ps1 b/updatecli/current-jenkins.ps1 deleted file mode 100644 index d4af08e25c..0000000000 --- a/updatecli/current-jenkins.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -param( - [Parameter(Position = 0)] - [string] $PomPath -) - -[xml]$xml = Get-Content $PomPath -$xml.project.properties.'jenkins.version' diff --git a/updatecli/update-jenkins.ps1 b/updatecli/update-jenkins.ps1 deleted file mode 100644 index 3f1091d4b0..0000000000 --- a/updatecli/update-jenkins.ps1 +++ /dev/null @@ -1,32 +0,0 @@ -param( - [Parameter(Position = 0)] - [string] $PomPath, - [Parameter(Position = 1)] - [version] $NewVersion -) - -$changed = $false -if ($null -eq $ENV:DRY_RUN) { - $ENV:DRY_RUN = $false -} - -$pom = New-Object System.Xml.XmlDocument -$pom.PreserveWhitespace = $true -$pom.Load($PomPath) - -[version]$CurrentVersion = $pom.project.properties.'jenkins.version' -if ($null -ne $CurrentVersion -and $NewVersion -gt $CurrentVersion) { - $changed = $true - $pom.project.properties.'jenkins.version' = $NewVersion -} - -if ($changed) { - Write-Output "$NewVersion" - - if ($ENV:DRY_RUN -eq $false) { - $utf8WithoutBom = New-Object System.Text.UTF8Encoding($false) - $streamWriter = New-Object System.IO.StreamWriter($PomPath, $false, $utf8WithoutBom) - $pom.Save($streamWriter) - $streamWriter.Close() - } -} diff --git a/updatecli/updatecli.d/update-integrations-jenkins.yaml b/updatecli/updatecli.d/update-integrations-jenkins.yaml deleted file mode 100644 index f10afd1a09..0000000000 --- a/updatecli/updatecli.d/update-integrations-jenkins.yaml +++ /dev/null @@ -1,56 +0,0 @@ -scms: - github: - kind: github - spec: - user: '{{ .github.user }}' - email: '{{ .github.email }}' - owner: '{{ .github.owner }}' - repository: '{{ .github.repository }}' - branch: '{{ .github.branch }}' - username: '{{ .github.username }}' - token: '{{ requiredEnv .github.token }}' -sources: - jenkins: - name: Get Last jenkins Weekly Version - kind: jenkins - spec: - release: stable - github: - token: '{{ requiredEnv .github.token }}' - username: '{{ .github.username }}' - current-jenkins: - name: Get Current jenkins Version - kind: shell - spec: - command: pwsh -NoProfile -File {{ requiredEnv "GITHUB_WORKSPACE" }}/updatecli/current-jenkins.ps1 -PomPath integrations/pom.xml -conditions: - jenkins: - name: Test if Jenkins stable published - kind: maven - sourceid: jenkins - spec: - url: repo.jenkins-ci.org - repository: releases - groupId: org.jenkins-ci.main - artifactId: jenkins-war -targets: - jenkins: - name: Update Jenkins version - sourceid: jenkins - scmid: github - kind: shell - spec: - command: pwsh -NoProfile -File {{ requiredEnv "GITHUB_WORKSPACE" }}/updatecli/update-jenkins.ps1 -PomPath integrations/pom.xml -NewVersion -pullrequests: - jenkins: - title: Bump jenkins.version from {{ source "current-jenkins" }} to {{ source "jenkins" }} - kind: github - scmid: github - targets: - - jenkins - spec: - labels: - - dependencies - automerge: true - mergemethod: squash - usetitleforautomerge: true diff --git a/updatecli/values.yaml b/updatecli/values.yaml deleted file mode 100644 index f479092128..0000000000 --- a/updatecli/values.yaml +++ /dev/null @@ -1,8 +0,0 @@ -github: - user: "GitHub Actions" - email: "41898282+github-actions[bot]@users.noreply.github.com" - username: "github-actions" - token: "UPDATECLI_GITHUB_TOKEN" - owner: "jenkinsci" - repository: "configuration-as-code-plugin" - branch: "master"