image: name: hashicorp/packer:light entrypoint: [""] variables: PACKER_CONFIG_DIR: $CI_PROJECT_DIR cache: key: "packer-plugins" # Define a key for Packer plugins paths: - "$PACKER_CONFIG_DIR/.packer.d" stages: - validate - build .parallel: parallel: matrix: - IMAGE: - flatcar-stable validate: extends: .parallel stage: validate variables: PACKER_WORKSPACE: images script: - packer init $PACKER_WORKSPACE - packer fmt -check $PACKER_WORKSPACE - packer validate $PACKER_WORKSPACE build-image: extends: .parallel stage: build script: - packer build $IMAGE.pkr.hcl rules: - if: $CI_COMMIT_BRANCH == "main"