Skip frontend-testing image by default
PRODX-24841
Change-Id: I15fcac4f6e19a9c3d64a253b2f89690fac6b43ed
diff --git a/src/com/mirantis/mcp/Git.groovy b/src/com/mirantis/mcp/Git.groovy
index 53efa09..46516ca 100644
--- a/src/com/mirantis/mcp/Git.groovy
+++ b/src/com/mirantis/mcp/Git.groovy
@@ -200,3 +200,21 @@
]
)
}
+
+/**
+ * Returns array of changed file names since last commit
+ * using optionally specified regexp filter.
+ *
+ * @param filter String, apply grep regexp
+ * '.*' (Default): returns all files
+ * regexp : returns regexp-ed files
+ */
+def getChangedFiles(String filter = '.*') {
+ def res = []
+ try {
+ res = sh(script: "git diff HEAD~1 --name-only | grep -E '${filter}'", returnStdout: true).split().collect{it as String}
+ } catch (Exception e) {
+ println "Exception: '$e', probably filter '$filter' finds no files"
+ }
+ return res
+}