We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 496b57b commit cb14cdfCopy full SHA for cb14cdf
src/devops/common/helpers.groovy
@@ -1,7 +1,22 @@
1
// src/devops/common/helpers.groovy
2
package devops.common
3
4
-// private method for vars
+// imports
5
+import hudson.AbortException
6
+
7
+// generic tool execution
8
+void toolExec(String label, List<String> cmd) {
9
+ try {
10
+ sh(label: label, script: cmd.join(' '))
11
+ }
12
+ catch (AbortException error) {
13
+ print "failure using ${label.toLowerCase()}"
14
+ throw error
15
16
+ print "${label.toLowerCase()} was successful"
17
+}
18
19
+// hashi vars
20
List<String> varSubCmd(Map config) {
21
List<String> subCmd = []
22
0 commit comments