views.groovy 3.58 KB
Newer Older
1 2 3 4 5 6
// Read the contents of the gathered-structure.json file a step created for us previously
def structureToParse = readFileFromWorkspace('gathered-structure.json')
def knownStructure = new groovy.json.JsonSlurper().parseText( structureToParse )

// Prepare a list of supported OSes for later use
def supportedOSes = [
7 8 9
	'Linux':   '.* SUSEQt5.[0-9]+$',
	'FreeBSD': '.* FreeBSDQt5.12$',
	'Windows': '.* WindowsMSVCQt5.[0-9]+$'
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
]

// Setup a view for each OS we support
supportedOSes.each {
	// Some preparation to create the view...
	def jobRegex = "^${it.value}"
	def viewName = "OS - ${it.key}"
	def osName   = "${it.key}"

	// Now create the view
	listView( viewName ) {
		// Give it a nice description
		description("Current Status of ${osName} builds")
		// We want to recurse when looking for our jobs
		recurse()
		// Only include jobs matching the previously provided regex
		jobs {
			regex( jobRegex )
		}
		// Include a reasonable/sane set of Columns
		columns {
			status()
			weather()
			name()
			lastSuccess()
			lastFailure()
			lastDuration()
			buildButton()
		}
	}
}

42 43 44 45 46 47 48
// Setup a global failing view
listView( "Failing" ) {
	// Give it a nice description
	description("Jobs currently failing on the CI system")
	// We want to recurse when looking for our jobs
	recurse()
	// Ensure we match all jobs by name, but only include failures...
Ben Cooksley's avatar
Ben Cooksley committed
49
	jobFilters {
Ben Cooksley's avatar
Ben Cooksley committed
50 51
		status {
			status(Status.FAILED)
52 53 54 55 56 57 58 59 60 61 62 63 64 65
		}
	}
	// Include a reasonable/sane set of Columns
	columns {
		status()
		weather()
		name()
		lastSuccess()
		lastFailure()
		lastDuration()
		buildButton()
	}
}

66 67 68 69 70 71 72 73 74 75 76 77 78 79
// Setup a recursive view inside each Platform's folder so people can see a big overall view should they so wish
knownStructure.products.each {
	// Prepare to create the view
	def product  = "${it}"
	def viewName = "${it}/Everything"

	// Now create the view
	listView( viewName ) {
		// Give it a nice description
		description("Current Status of all ${product} builds")
		// We want to recurse when looking for our jobs
		recurse()
		// Only include jobs matching the previously provided regex
		jobs {
Ben Cooksley's avatar
Ben Cooksley committed
80
			regex( '.* .*' )
81 82 83 84 85 86 87 88 89 90 91 92 93 94
		}
		// Include a reasonable/sane set of Columns
		columns {
			status()
			weather()
			name()
			lastSuccess()
			lastFailure()
			lastDuration()
			buildButton()
		}
	}
}

95
// Setup per Branch Group and per Platform views inside each Product as well for those wanting to monitor on that level
96 97 98 99 100 101 102 103 104 105 106 107 108 109
knownStructure.combinations.each {
	// Grab all the info out for later use
	def product      = "${it.product}"
	def branchGroup  = "${it.branchGroup}"
	def platform     = "${it.platform}"

	// Create the view for the overall branch group view
	listView( "${it.product}/Everything - ${it.branchGroup}" ) {
		// Give it a nice description
		description("Current Status of all ${product} builds")
		// We want to recurse when looking for our jobs
		recurse()
		// Only include jobs matching the previously provided regex
		jobs {
110
			regex( ".*${branchGroup}.*" )
111 112 113 114 115 116 117 118 119 120 121 122
		}
		// Include a reasonable/sane set of Columns
		columns {
			status()
			weather()
			name()
			lastSuccess()
			lastFailure()
			lastDuration()
			buildButton()
		}
	}
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144

	// Create the view for the platform level view
	listView( "${it.product}/Platform - ${it.platform}" ) {
		// Give it a nice description
		description("Current Status of all ${product} builds on ${platform}")
		// We want to recurse when looking for our jobs
		recurse()
		// Only include jobs matching the previously provided regex
		jobs {
			regex( ".* ${platform}" )
		}
		// Include a reasonable/sane set of Columns
		columns {
			status()
			weather()
			name()
			lastSuccess()
			lastFailure()
			lastDuration()
			buildButton()
		}
	}
145
}