-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Tim Jacomb <[email protected]>
- Loading branch information
Showing
8 changed files
with
222 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ pct-report.* | |
logs/ | ||
megawar.war | ||
pct.jar | ||
|
||
plugin-manager.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
param( | ||
[string] $JenkinsVersion, | ||
[string] $PluginManagerJar = './plugin-manager.jar' | ||
) | ||
|
||
$JenkinsVersionX = $JenkinsVersion -replace '\d+$', 'x' | ||
|
||
if (Get-Command 'java' -ErrorAction SilentlyContinue) { | ||
$java = 'java' | ||
} elseif ($IsLinux) { | ||
$java = '/usr/bin/java' | ||
} else { | ||
$java = 'java' | ||
} | ||
|
||
$pomPath = "bom-${JenkinsVersionX}/pom.xml" | ||
$pom = New-Object System.Xml.XmlDocument | ||
$pom.PreserveWhitespace = $true | ||
$pom.Load($pomPath) | ||
|
||
# Select Dependencies and Skip BOM | ||
$dependencies = $pom.Project.DependencyManagement.Dependencies.Dependency | Select-Object -Skip 1 | ||
|
||
foreach ($dependency in $dependencies) { | ||
$artifact = $dependency.artifactId | ||
$oldVersion = $dependency.version | ||
$plugin = "${artifact}:${oldVersion}" | ||
[string] $output = & $java -jar "$PluginManagerJar" --no-download --available-updates --jenkins-version "$JenkinsVersion" --plugins $plugin | ||
if ($null -ne $output -and $output -inotlike '*No available updates*') { | ||
# Example output: | ||
# Available updates: | ||
# credentials (2.6.1) has an available update: 2.6.1.1 | ||
|
||
# Grab the version number at the end of the line | ||
$newVersion = ($output | Select-String -Pattern 'update: (.+)').matches.Groups[1].Value | ||
Write-Output "Changed $artifact from $oldVersion to $newVersion" | ||
$dependency.version = $newVersion | ||
} | ||
} | ||
|
||
$pom.Save($pomPath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -eux -o pipefail | ||
|
||
jenkinsVersion="$1" | ||
jar="${PLUGIN_MANAGER_JAR_PATH:-"./plugin-manager.jar"}" | ||
|
||
# check if jar does not exist | ||
if [ ! -f "$jar" ]; then | ||
curl -sSL https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.12.3/jenkins-plugin-manager-2.12.3.jar -o "$jar" | ||
fi | ||
|
||
pwsh -NoProfile -File "./updatecli/updatecli.d/update-plugins.ps1" -JenkinsVersion "${jenkinsVersion}" -PluginManagerJar "${jar}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
--- | ||
scms: | ||
github: | ||
kind: github | ||
spec: | ||
user: "{{ .github.user }}" | ||
email: "{{ .github.email }}" | ||
owner: "{{ .github.owner }}" | ||
repository: "{{ .github.repository }}" | ||
token: "{{ requiredEnv .github.token }}" | ||
username: "{{ .github.username }}" | ||
branch: "{{ .github.branch }}" | ||
|
||
sources: | ||
jenkins2.289.x: | ||
name: Get Last Jenkins Stable Version | ||
kind: githubrelease | ||
spec: | ||
owner: "jenkinsci" | ||
repository: "jenkins" | ||
token: "{{ requiredEnv .github.token }}" | ||
versionfilter: | ||
kind: regex | ||
pattern: 'jenkins-2.289.\d+$' | ||
transformers: | ||
- trimPrefix: "jenkins-" | ||
jenkins2.303.x: | ||
name: Get Last Jenkins Stable Version | ||
kind: githubrelease | ||
spec: | ||
owner: "jenkinsci" | ||
repository: "jenkins" | ||
token: "{{ requiredEnv .github.token }}" | ||
versionfilter: | ||
kind: regex | ||
pattern: 'jenkins-2.303.\d+$' | ||
transformers: | ||
- trimPrefix: "jenkins-" | ||
jenkins2.319.x: | ||
name: Get Last Jenkins Stable Version | ||
kind: githubrelease | ||
spec: | ||
owner: "jenkinsci" | ||
repository: "jenkins" | ||
token: "{{ requiredEnv .github.token }}" | ||
versionfilter: | ||
kind: regex | ||
pattern: 'jenkins-2.319.\d+$' | ||
transformers: | ||
- trimPrefix: "jenkins-" | ||
jenkins2.332.x: | ||
name: Get Last Jenkins Stable Version | ||
kind: githubrelease | ||
spec: | ||
owner: "jenkinsci" | ||
repository: "jenkins" | ||
token: "{{ requiredEnv .github.token }}" | ||
versionfilter: | ||
kind: regex | ||
pattern: 'jenkins-2.332.\d+$' | ||
transformers: | ||
- trimPrefix: "jenkins-" | ||
conditions: | ||
jenkins2.289.x: | ||
name: Test if Jenkins stable published | ||
kind: maven | ||
sourceid: jenkins2.289.x | ||
spec: | ||
url: "repo.jenkins-ci.org" | ||
repository: "releases" | ||
groupid: "org.jenkins-ci.main" | ||
artifactid: "jenkins-war" | ||
jenkins2.303.x: | ||
name: Test if Jenkins stable published | ||
kind: maven | ||
sourceid: jenkins2.303.x | ||
spec: | ||
url: "repo.jenkins-ci.org" | ||
repository: "releases" | ||
groupid: "org.jenkins-ci.main" | ||
artifactid: "jenkins-war" | ||
jenkins2.319.x: | ||
name: Test if Jenkins stable published | ||
kind: maven | ||
sourceid: jenkins2.319.x | ||
spec: | ||
url: "repo.jenkins-ci.org" | ||
repository: "releases" | ||
groupid: "org.jenkins-ci.main" | ||
artifactid: "jenkins-war" | ||
jenkins2.332.x: | ||
name: Test if Jenkins stable published | ||
kind: maven | ||
sourceid: jenkins2.332.x | ||
spec: | ||
url: "repo.jenkins-ci.org" | ||
repository: "releases" | ||
groupid: "org.jenkins-ci.main" | ||
artifactid: "jenkins-war" | ||
targets: | ||
jenkins2.289.x: | ||
name: 'Update 2.289.x plugins' | ||
sourceid: jenkins2.289.x | ||
kind: shell | ||
spec: | ||
command: bash ./updatecli/updatecli.d/update-plugins.sh | ||
scmid: github | ||
jenkins2.303.x: | ||
name: 'Update 2.303.x plugins' | ||
sourceid: jenkins2.303.x | ||
kind: shell | ||
spec: | ||
command: bash ./updatecli/updatecli.d/update-plugins.sh | ||
scmid: github | ||
jenkins2.319.x: | ||
name: 'Update 2.319.x plugins' | ||
sourceid: jenkins2.319.x | ||
kind: shell | ||
spec: | ||
command: bash ./updatecli/updatecli.d/update-plugins.sh | ||
scmid: github | ||
jenkins2.332.x: | ||
name: 'Update 2.332.x plugins' | ||
sourceid: jenkins2.332.x | ||
kind: shell | ||
spec: | ||
command: bash ./updatecli/updatecli.d/update-plugins.sh | ||
scmid: github | ||
pullrequests: | ||
default: | ||
title: 'Bump pinned plugins' | ||
kind: github | ||
scmid: github | ||
targets: | ||
- jenkins2.289.x | ||
- jenkins2.303.x | ||
- jenkins2.319.x | ||
- jenkins2.332.x | ||
spec: | ||
labels: | ||
- dependencies | ||
automerge: true | ||
mergemethod: squash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ github: | |
token: "UPDATECLI_GITHUB_TOKEN" | ||
owner: "jenkinsci" | ||
repository: "bom" | ||
branch: "master" | ||
branch: "master" |