<p>Users can now specify their own teardown steps in Screwdriver, which will always run regardless of build status. These steps need to be defined at the end of the job and start with <code>teardown-</code>.</p>
<p><del>Note: These steps run in separate shells. As a result, environment variables set by previous steps will not be available.<del></del></del></p>
<p><b>Update 8/22/2018</b>: Environment variables set by user steps are now available in teardown steps.</p>
<h2>Example screwdriver.yaml</h2>
<pre><code>jobs:
main:
image: node:8
steps:
- fail: command-does-not-exist
- teardown-step1: echo hello
- teardown-step2: echo goodbye
requires:
- ~commit
- ~pr
</code></pre>
<p>In this example, the steps <code>teardown-step1</code> and <code>teardown-step2</code> will run even though the build fails:</p>
<p><figure class="tmblr-full" data-orig-height="281" data-orig-width="540" data-orig-src="https://66.media.tumblr.com/8d413796c5dbda1f503d3f0fc7a7f9eb/tumblr_inline_pbrobbpB7O1qf05nt_540.png"><img src="https://66.media.tumblr.com/be9c2415f2b5ca62d84a16acc57dae4c/tumblr_inline_pdvyy7iX3v1qf05nt_540.png" alt="" data-orig-height="281" data-orig-width="540" data-orig-src="https://66.media.tumblr.com/8d413796c5dbda1f503d3f0fc7a7f9eb/tumblr_inline_pbrobbpB7O1qf05nt_540.png"/></figure></p>
<h2>Compatibility List</h2>
<p>User teardown support requires the following minimum versions of Screwdriver:</p>
<ul><li><a href="https://hub.docker.com/r/screwdrivercd/launcher">screwdrivercd/launcher</a>: v4.0.116</li>
<li><a href="https://hub.docker.com/r/screwdrivercd/screwdriver">screwdrivercd/screwdriver</a>: v0.5.405</li>
</ul><h2>Contributors</h2>
<p>Thanks to the following people for making this feature possible:</p>
<ul><li><p><a href="https://github.com/d2lam">d2lam</a></p></li>
<li><p><a href="https://github.com/tk3fftk">tk3fftk</a> (from Yahoo! JAPAN)</p></li>
</ul><p>Screwdriver is an open-source build automation platform designed for Continuous Delivery.
It is built (and used) by Yahoo. Don’t hesitate to reach out if you have questions or would like to contribute: <a href="http://docs.screwdriver.cd/about/support.">http://docs.screwdriver.cd/about/support.</a></p>