Skip to content

Artifact and Cache support for PowerShell

This MR adds support for generating and using caches, as well as uploading artifact bundles from within the PowerShell executor. It is dependent on !51 (closed) and !52 (merged) for their archive and upload functionality and also refactors the way in which scripts are written for PowerShell (and maybe other terminals as well) to instead use text/template - making it far easier to read and reason about the code.

text/template refactor

This is a refactoring of the way scripts are generated which makes it quite a bit easier to understand exactly what is going on, and removes lots of room for error when writing/updating those scripts. It makes use of go's text/template language, which is very easy to follow and extend with additional functions as needed.

Currently I've only implemented the PowerShell shell on top of this, but I'd appreciate feedback on whether you like the approach or not. If you do then that's what I'll build on for !51 (closed) and !52 (merged)'s integration into PowerShell for #298 (closed).

There are a couple of gotchas - specifically revolving around refactoring (if you rename properties on the info object which is passed to the runner then you will need to manually action those renames within the scripts. I also feel that it would probably be even nicer if we moved from storing the values in strings to instead having files which are automatically embedded during compile time (see go.rice for an example of doing that).

/cc @ayufan

P.S. This will probably need a rebase, will get round to it 😉

Merge request reports