Joey Armstrong | 379660e | 2022-12-14 19:21:00 -0500 | [diff] [blame] | 1 | #!/usr/bin/env groovy |
| 2 | // ----------------------------------------------------------------------- |
| 3 | // ----------------------------------------------------------------------- |
| 4 | |
| 5 | // ----------------------------------------------------------------------- |
| 6 | // ----------------------------------------------------------------------- |
| 7 | def getIam(String func) |
| 8 | { |
| 9 | // Cannot rely on a stack trace due to jenkins manipulation |
| 10 | String src = 'vars/showCommands' |
| 11 | String iam = [src, func].join('::') |
| 12 | return iam |
| 13 | } |
| 14 | |
| 15 | // ----------------------------------------------------------------------- |
| 16 | // ----------------------------------------------------------------------- |
| 17 | def process(Map config) |
| 18 | { |
Joey Armstrong | 7adbfb0 | 2023-01-24 17:02:37 -0500 | [diff] [blame] | 19 | String iam = getIam('process') |
Joey Armstrong | 379660e | 2022-12-14 19:21:00 -0500 | [diff] [blame] | 20 | |
| 21 | // list.each{ } could be used here but simple for now. |
| 22 | println("** ${iam}: voltctl command attributes") |
| 23 | sh('''which -a voltctl''') |
| 24 | sh('''voltctl version''') |
| 25 | |
| 26 | return |
| 27 | } |
| 28 | |
| 29 | // ----------------------------------------------------------------------- |
| 30 | // ----------------------------------------------------------------------- |
| 31 | def call(Map config) |
| 32 | { |
| 33 | String iam = getIam('main') |
| 34 | println("** ${iam}: ENTER") |
| 35 | |
| 36 | if (!config) |
| 37 | { |
| 38 | config = [:] |
| 39 | } |
| 40 | |
| 41 | try |
| 42 | { |
| 43 | process(config) |
| 44 | } |
| 45 | catch (Exception err) |
| 46 | { |
| 47 | println("** ${iam}: EXCEPTION ${err}") |
| 48 | throw err |
| 49 | } |
| 50 | finally |
| 51 | { |
| 52 | println("** ${iam}: LEAVE") |
| 53 | } |
| 54 | return |
| 55 | } |
| 56 | |
| 57 | // EOF |