This file contains hidden or 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
cmd = "./restart.sh ${server} ${containerName}" | |
println("INFO: Restarting the container: ${cmd}") | |
def proc = cmd.execute() | |
proc.waitForProcessOutput(System.out, System.err) | |
def errorCode = proc.exitValue() |
This file contains hidden or 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
pipeline { | |
agent { label "linux"} | |
stages { | |
stage('1') { | |
steps { | |
script { | |
def tests = [:] | |
for (f in ['a', 'b']) { | |
tests["${f}"] = { | |
node('linux') { |
This file contains hidden or 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
def RunUnitTests() { | |
println("INFO: Running Unit Tests") | |
def tests = [:] | |
// define unit tests here | |
tests["GetNodesByLabel"] = { | |
assert GetNodesByLabel().collect{it.name}.size() > 0 | |
} | |
This file contains hidden or 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
// https://gist.github.com/askalee/2148608fb4423d97ded690829daae173 | |
// HISTORY: | |
// * 2017/10/19: show free disk size for all nodes | |
// * 2017/10/23: auto check nodes labeled with _autoClean | |
// * 2017/10/26: 1. monitor all nodes instead of only monitor specific nodes with certain label | |
// 2. catch exceptions | |
import hudson.model.*; | |
import hudson.util.*; | |
import jenkins.model.*; |
This file contains hidden or 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
// https://gist.github.com/askalee/2c26aa57ca46efe2b1239da03c700497 | |
import hudson.model.*; | |
import hudson.util.*; | |
import jenkins.model.*; | |
import hudson.FilePath.FileCallable; | |
import hudson.slaves.OfflineCause; | |
import hudson.node_monitors.*; | |
def DEBUG_MODE = (build.getEnvironment(listener).get('DEBUG_MODE') == "true") |
This file contains hidden or 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
<QueryList> | |
<Query Id="0" Path="Security"> | |
<Select Path="Security">* | |
[System | |
[Provider | |
[@Name='Microsoft-Windows-Security-Auditing'] | |
and | |
TimeCreated[timediff(@SystemTime) <= 86400000] | |
] | |
and EventData[Data="joe"] |
NewerOlder