Skip to content

Instantly share code, notes, and snippets.

View jeffnelson's full-sized avatar

Jeff Nelson jeffnelson

  • Target Corporation - Supply Chain
  • Minneapolis, MN
View GitHub Profile
jeffnelson / getUpstreamTriggerBuildResult.groovy
Created October 25, 2018 21:07
jenkins groovy script to get the build result of a given build's upstream cause
import jenkins.model.Jenkins
import hudson.model.AbstractItem
import hudson.model.Cause
// === this code enables you to run this whole thing ===
// === just in console ===
def currentBuild = Jenkins.instance.getAllItems(AbstractItem.class)
.findAll{ it.fullName == "my/org/job-name" }
.collect{ it.builds.findAll{ it.number == 3 } } // desired build number of "my/org/job-name"
jeffnelson / switchColors.groovy
Created March 1, 2018 18:31
groovy script using aws java sdk to tell aws target groups to switch targets between blue and green
import groovy.json.JsonOutput
jeffnelson /
Created February 2, 2018 17:35
simple bash script to loop, pinging spinnaker services' health endpoints, until all report healthy
## Helper script to use when we need to restart/redeploy spinnaker due to config changes or some other reason.
## This script has been written for a local debian install of spinnaker (all services running on the same box), but could be adapted fairly easily for a distributed install
## Steps:
## - ping health endpoints for all services every 2 seconds, reporting status of each each iteration, until all report healthy