Publish from the CLI
The CLI does not expose the build-time auto-publish option.
Create the build, wait for it to complete, then apply an ImagePromotion manifest.
Procedure
-
Create an
ImageBuildmanifest and apply it. For a complete example, see Creating an image build from the CLI. -
Wait until the build completes:
$ flightctl get imagebuild/<image_build_name> -
Optional: create
ImageExportresources for disk formats you want in the catalog. See Image export. -
Create an
ImagePromotionmanifest. The following example publishes to a new item in thedefaultcatalog:apiVersion: flightctl.io/v1alpha1 kind: ImagePromotion metadata: name: <promotion_name> spec: source: imageBuildRef: <image_build_name> exportFormats: - container - qcow2 target: type: NewCatalogItem catalogName: default catalogItemName: <catalog_item_name> displayName: <display_name> version: "1.0.0" -
Apply the promotion and watch its status:
$ flightctl apply -f imagepromotion.yaml $ flightctl get imagepromotion/<promotion_name> -o yamlWait until
status.phaseisCompleted. If the phase isWaitingForArtifacts, wait for exports to finish or adjustexportFormats. -
Verify the catalog item:
$ flightctl get catalogitems --catalog default