Edit on GitHubCommand Reference:
Command Reference: asset publish
cml asset publish [options] <asset file>Upload a file, such as an image, and print a URL for embedding it in a CML
report. cml comment create does this automatically for
local files linked from the report.
The default server, asset.cml.dev, no longer accepts uploads. Use --native
on GitLab and Bitbucket, or --url with your own server. See
Image Hosting.
Options
Any generic option in addition to:
-
--md: Produce output in Markdown format. -
-t=<...>,--title=<...>: Title for Markdown output. -
--mime-type=<...>: Content MIME type [default: inferred from content]. -
--native: Upload to the CI provider's own storage (GitLab and Bitbucket only). -
--url=<...>: Self-hosted image server URL, also read from theCML_ASSET_URLenvironment variable.
Examples
To render an image in a Markdown file, using your own image server:
$ export CML_ASSET_URL="https://images.example.com/?token=..."
$ cml asset publish ./plot.png --md >> report.mdOn GitLab or Bitbucket, using the provider's storage:
$ cml asset publish --native ./plot.png --md >> report.md