Skip to main content

Artifacts

Artifacts allow you to archive files generated by playbook actions to a file store of your choice.

Prerequisites

The following actions support archiving artifacts

Each action type handles artifact generation differently. See the documentation for each action for details.

Archiving a directory

For the following script in an exec action

mkdir -p /tmp/results
curl -sL 'https://example.com' > /tmp/results/example.com
curl -sL 'https://flanksource.com' > /tmp/results/flanksource.com

You can add the artifact paths as follows

archive-websites.yaml
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
name: archive-websites
spec:
actions:
- name: Download example.com and flanksource.com
exec:
script: |
mkdir -p /tmp/results
curl -sL 'https://example.com' > /tmp/results/example.com
curl -sL 'https://flanksource.com' > /tmp/results/flanksource.com
artifacts:
- path: /tmp/results/example.com
- path: /tmp/results/flanksource.com

or, use a glob as

artifacts
- path: '/tmp/results/*.com'

Archiving output from stdout/stderr

The path field accepts two standard paths

  • /dev/stdout
  • /dev/stderr
archive-website.yaml
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
name: archive-website
spec:
actions:
- name: Archive response of example.com
exec:
script: |
curl -sL 'https://example.com'
artifacts:
- path: /dev/stdout
- path: /dev/stderr