deis / jenkins-jobs

DSL representations of Jenkins jobs for Deis
MIT License
27 stars 18 forks source link

Capture boilerplate shell contents in reusable function #214

Open vdice opened 8 years ago

vdice commented 8 years ago

We have a lot of shell scripts in the form of

#!/usr/bin/env bash
set -eo pipefail

<main script contents>

It would be handy to define a function that wrapped the <main script contents> in the boilerplate seen above; something like:

def sh = { String script ->
  """
    #!/usr/bin/env bash

    set -eo pipefail

    ${script}
  """.stripIndent()
}

(Might possibly entertain overriding the existing shell dsl function to do the same.)

Cryptophobia commented 6 years ago

This issue was moved to teamhephy/jenkins-jobs#12