Filesystem outputs

Every executable Mint task outputs a filesystem layer containing all of the files that were modified while the task executed. When a task uses other tasks, it runs on a filesystem containing all of the layers from the tasks it uses. See the documentation on use for more information.

Output filesystem filtering

You can filter which files a task includes in its output layer:

tasks:
  - key: filtered-output-layer
    run: |
      echo a | tee a.txt
      echo b | tee b.txt
      echo root1 | sudo tee /root1.txt
      echo root2 | sudo tee /root2.txt
    outputs:
      filesystem:
        filter:
          workspace: [a.txt]
          system: [root1.txt]

The above task will include only /root1.txt and /var/mint-workspace/a.txt in its output layer.

Output filesystem filters use the same filtering syntax as input file filters.

If you want to exclude all files from the output layer, you can specify an empty array for both workspace and system:

tasks:
  - key: filtered-output-layer
    run: |
      echo a | tee a.txt
      echo root1 | sudo tee /root1.txt
    outputs:
      filesystem:
        filter:
          workspace: []
          system: []

If you only want to filter files in the workspace, you can pass an array directly to outputs.filesystem.filter:

tasks:
  - key: filtered-output-layer
    run: |
      echo a | tee a.txt
      echo b | tee b.txt
    outputs:
      filesystem:
        filter: [a.txt]

Note that using this shorthand will include, not exclude, all files outside the workspace.