ability to run a build step conditionally based on matrix

This commit is contained in:
Brad Rydzewski 2015-05-09 12:53:52 -07:00
parent b9484757ff
commit 062a31de08

View file

@ -105,3 +105,17 @@ func (c *Condition) MatchOwner(owner string) bool {
return c.Owner == owner
}
}
// MatchMatrix is a helper function that returns false
// to limit steps to only certain matrix axis.
func (c *Condition) MatchMatrix(matrix map[string]string) bool {
if len(c.Matrix) == 0 {
return true
}
for k, v := range c.Matrix {
if matrix[k] != v {
return false
}
}
return true
}