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
// This is how you use the code in your top level build.gradle | |
def computedVersion = new ComputedVersion() | |
ext.computedShortVersion = computedVersion.getVersion(rootDir.toString()) | |
ext.computedLongVersion = computedVersion.padVersion(computedShortVersion) | |
ext.computedTargetBranch = computedVersion.activeBranch | |
def computedVersionTest() { | |
// printing this here allows the tracking branch behavior to be | |
// tested manually. |
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
// Schedule builds TeamCity style: Given a dependency relationship between builds, | |
// start all builds whose prerequisite builds have completed. | |
// This is intended to be run as a system groovy script in Jenkins. | |
// Unbound variables: | |
// sleepSeconds - amount of time to sleep between polls. 5-15 seconds seem good. | |
// Every entry in the jobToRun map is expected to have this format: | |
// JobId: [ JobName: <actual jenkins name of the job>, |
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
// These two functions prove invaluable to understand and explore | |
// the jenkins data model. Include in a system groovy script or in | |
// the script console, and discover where the data really sits. | |
// See also http://stackoverflow.com/questions/32876496/how-can-i-retrieve-the-build-parameters-from-a-queued-job | |
// Credit to http://stackoverflow.com/users/172599/dave-bacher | |
def showProps(inst, prefix="Properties:") { | |
println prefix | |
for (prop in inst.properties) { |
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
#!/usr/bin/env python2.7 | |
# Filter a set of file paths using wildcarded inclusion and exclusion rules | |
# | |
# Usage: See tests below | |
# | |
# Restrictions: | |
# File paths are assumed to be relative paths. Leading slashes are ignored. | |
# File names may not contain wildcards. | |
# Supported wildcards: |