Skip to content

Instantly share code, notes, and snippets.

View or-shachar's full-sized avatar

Or Shachar or-shachar

View GitHub Profile
@or-shachar
or-shachar / count-failed-jobs.groovy
Created December 7, 2017 16:46
Counts jobs that failed by name
job_name="some-name" //I have multiple jobs with the same simple name under multiple folders
instance = Jenkins.instance
def jobs = instance.allItems.findAll{it.name==job_name}
count = 0
for (job in jobs){
lastRun = job.lastCompletedBuild
if (lastRun==null || lastRun.result != Result.SUCCESS){
println job.fullName + " " + instance.rootUrl + lastRun.url
count = count + 1
}
@or-shachar
or-shachar / stats-by-logs.groovy
Created December 7, 2017 13:18
Count all jobs of certain name that has certain string in their last run
job_name="some-job" //I have multiple jobs with the same simple name under multiple folders
lookup_string="something inside the log" // the line we want to look for
instance = Jenkins.instance
def jobs = instance.allItems.findAll{it.name==job_name}
count = 0
for (job in jobs){
lastRun = job.lastCompletedBuild
lastBuildLog = lastRun.log
if (lastBuildLog.contains(lookup_string)){
println job.fullName + " " + instance.rootUrl + lastRun.url
#!/bin/bash
BUILDTOOLS_REVISION=1a7c0ec10697afcb87af8a09f12c3f9b9ca56fb2
gopath=$(go env GOPATH)
github_go_fetch() {
cd /tmp
org=$1
repo=$2
revision=$3
package com.example
import MavenCoursierResolver._
import coursier.maven.MavenRepository
import coursier.{Dependency, Module, Platform, Resolution}
import scala.concurrent.duration.DurationInt
class MavenCoursierResolver() {