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 groovy.json.JsonOutput | |
def runningBuilds = Jenkins.instance.getView('All').getBuilds().findAll() { it.isInProgress() } | |
LinkedHashMap notificationPayload = [:] | |
runningBuilds.each{ value -> | |
String jobName = value.getFullDisplayName() | |
int durationInSeconds = (System.currentTimeMillis() - value.getStartTimeInMillis())/1000 | |
if (durationInSeconds > 3600) { | |
println("Job: ${jobName}, running for more than 1 hour long") | |
println("Running time: " + durationInSeconds) |
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
class DockerCleaner { | |
DockerRegistry dockerRegistry | |
DockerCleaner(DockerRegistry dockerRegistry) { | |
this.dockerRegistry = dockerRegistry | |
} | |
ArrayList getImageDangledManifests(String imageName) { | |
def imageTags = dockerRegistry.getImageTags(imageName) | |
return imageTags.manifest.findAll { |
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.model.Action | |
import com.cloudbees.workflow.flownode.FlowNodeUtil | |
import com.cloudbees.workflow.rest.external.StatusExt | |
import org.jenkinsci.plugins.workflow.graph.FlowNode | |
import org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode | |
import org.jenkinsci.plugins.workflow.cps.nodes.StepEndNode | |
import org.jenkinsci.plugins.workflow.actions.LabelAction |
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
# -*- coding: utf-8 -*- | |
''' | |
Proxmox runner | |
''' | |
import json | |
import salt.utils.event | |
import salt.client | |
def lvm_check(): |
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
# /srv/salt/upgrade_the_app.sls | |
# Example of a complex, multi-host Orchestration state that performs status checks as it goes. | |
# Note, this is untested and is meant to serve as an example. | |
# Run via: salt-run state.orch upgrade_the_app pillar='{nodes: [nodeA, nodeB], version: 123}' | |
{% set nodes = salt.pillar.get('nodes', []) %} | |
{% set all_grains = salt.saltutil.runner('cache.grains', | |
tgt=','.join(nodes), tgt_type='list') %} | |
{# Default version if not given at the CLI. #} |