drone/drone — pull request #101 by afex (2014-02-19 19:01:36+00:00)
Title: post-build commands, executed outside of the container

feedback wanted about this feature! thanks!

i was looking for a way to extract build artifacts from the container using the [docker cp](http://docs.docker.io/en/latest/commandline/cli/#cp) command. i was hoping to implement this as a "publisher", but drone currently implements publishers as scripts injected into the container and i didn't want to fundamentally change how they worked.

instead of implementing a "docker cp"-specific setting, i figured that allowing any commands to run after the container has stopped, but before the container is deleted would be useful. the current implementation only passes in a CONTAINER_ID environment variable.

example:

```
post-build:
- docker cp $CONTAINER_ID:/tmp/myapp.tgz /builds/myapp/
```