Skip to content

Instantly share code, notes, and snippets.

@ctran
Last active May 9, 2023 12:21
Show Gist options
  • Save ctran/8f82adedaa23ea924c52 to your computer and use it in GitHub Desktop.
Save ctran/8f82adedaa23ea924c52 to your computer and use it in GitHub Desktop.

Revisions

  1. ctran revised this gist Oct 14, 2015. No changes.
  2. ctran revised this gist Oct 14, 2015. 1 changed file with 6 additions and 7 deletions.
    13 changes: 6 additions & 7 deletions check-slave-jar-version.groovy
    Original file line number Diff line number Diff line change
    @@ -3,13 +3,12 @@ import hudson.remoting.Launcher
    import hudson.slaves.SlaveComputer

    def expectedVersion = Launcher.VERSION

    for (computer in Jenkins.instance.getComputers()) {
    if (! (computer instanceof SlaveComputer)) continue
    if (!computer.getChannel()) continue
    if (! (computer instanceof SlaveComputer)) continue
    if (!computer.getChannel()) continue

    def version = computer.getSlaveVersion()
    if (!expectedVersion.equals(version)) {
    println "${computer.name} - expected ${expectedVersion} but got ${version}"
    }
    def version = computer.getSlaveVersion()
    if (!expectedVersion.equals(version)) {
    println "${computer.name} - expected ${expectedVersion} but got ${version}"
    }
    }
  3. ctran created this gist Oct 14, 2015.
    15 changes: 15 additions & 0 deletions check-slave-jar-version.groovy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    import jenkins.model.*
    import hudson.remoting.Launcher
    import hudson.slaves.SlaveComputer

    def expectedVersion = Launcher.VERSION

    for (computer in Jenkins.instance.getComputers()) {
    if (! (computer instanceof SlaveComputer)) continue
    if (!computer.getChannel()) continue

    def version = computer.getSlaveVersion()
    if (!expectedVersion.equals(version)) {
    println "${computer.name} - expected ${expectedVersion} but got ${version}"
    }
    }