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
| import jenkins.model.*; | |
| import hudson.model.Job; | |
| import hudson.model.Run; | |
| import hudson.model.queue.QueueTaskFuture; | |
| import org.jenkinsci.plugins.workflow.cps.replay.ReplayAction; | |
| String text = "node('some-node') { echo 'hi'; }" |
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
| import java.io.IOException; | |
| import java.nio.charset.StandardCharsets; | |
| import java.security.Key; | |
| import java.security.KeyStore; | |
| import java.security.KeyStoreException; | |
| import java.security.NoSuchAlgorithmException; | |
| import java.security.UnrecoverableKeyException; | |
| import java.security.cert.CertificateException; | |
| import java.security.cert.X509Certificate; |
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
| kubectl get events -o json | jq '.items[] | .lastTimestamp + "," + .message' | tr -d '"' | awk -F',' '{cmd="date +\"%d/%b/%Y:%T\" --date=" $1; cmd | getline conv_date; print "[" conv_date "] (kubectl events) " $2}' |
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
| interval_dict = OrderedDict([ | |
| ('hr', 3600*1000), | |
| ('min', 60*1000), | |
| ('sec', 1000), | |
| ('ms' , 1), | |
| ]) | |
| def convert_to_ms(string): | |
| interval_regex = re.compile( "^[<]?(?P<value>(\d\.)?[0-9]+) (?P<unit>({0}))".format("|".join(interval_dict.keys())) ) |
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
| import hudson.slaves.* | |
| import hudson.model.* | |
| for (aSlave in hudson.model.Hudson.instance.slaves) { | |
| if (aSlave.name.indexOf("medium-rt-framework") == 0 && !aSlave.getComputer().isOnline()) { | |
| aSlave.getComputer().setTemporarilyOffline(true, null) | |
| aSlave.getComputer().doDoDelete() | |
| } | |
| } |
NewerOlder