During pipeline office hours, we brainstormed about a new feature that would be helpful for users wanting to process files that were created as a result of running the container in a previous stage. We could conceivably implement a feature that was already stubbed out for future use, namely the publish.files configuration.
Example:
stages: - name: test build: test run: image: true publish: files: - from: '${.container}' source: coverage.xml destination: coverage.xml
In the above example, the file coverage.xml is copied from the stopped container of the current stage into the workspace. The ${.container} context variable would reference the name of the stopped container, and source and destination would reference the file source within the container filesystem and destination relative to the working directory. Implementation would likely use docker cp container:path path.
Subsequent stages may then copy that file during the build step and process it from the entrypoint or a builder command.