Skip to main content

Packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.

🚀 Usage​

Add the following command to your CI/CD pipeline to install Packer:

fluentci run --wasm packer setup

Commands​

NameDescription
setupInstall Packer.
buildBuild image(s) from template
fixFix templates from old versions of packer
fmtRewrites HCL2 config files to canonical format
hcl2_upgradeTransform a JSON template into an HCL2 configuration
initInstall missing plugins or upgrade plugins
inspectSee components of a template
pluginsInteract with Packer plugins and catalog
validateCheck that a template is valid

Code Examples​

Add fluentci-pdk to your Cargo.toml:

[dependencies]
fluentci-pdk = "0.2.1"

Use the following code to call a module function:

use fluentci_pdk::dag;

// ...

dag().call("https://pkg.fluentci.io/[email protected]?wasm=1", "setup", vec!["latest"])?;

CI/CD Integrations​

The following CI/CD integrations FluentCI with popular CI/CD platforms to build images:

ci.yml
name: ci
on:
push:
branches:
- main
jobs:
tasks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Fluent CI
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
plugin: packer
args: |
init .
validate .
build .