mirror of
https://github.com/hashicorp/packer.git
synced 2026-04-20 21:59:08 -04:00
The lib name for the common components for writing packer_test suites was not clear, and did not follow the convention established in Packer core and plugins. Therefore this commit does two things: first the lib is renamed into common as to follow this convention, and clearly document which components are common to all tests. Also checkers are placed in a subpackage of common, common/check, so that it is clearer what is meant to be used as checks for a command's execution status after it's been run, as part of Assert.
20 lines
No EOL
937 B
Markdown
20 lines
No EOL
937 B
Markdown
## The Example Folder
|
|
|
|
This folder must contain a fully working example of the plugin usage. The example must define the `required_plugins`
|
|
block. A pre-defined GitHub Action will run `packer init`, `packer validate`, and `packer build` to test your plugin
|
|
with the latest version available of Packer.
|
|
|
|
The folder can contain multiple HCL2 compatible files. The action will execute Packer at this folder level
|
|
running `packer init -upgrade .` and `packer build .`.
|
|
|
|
If the plugin requires authentication, the configuration should be provided via GitHub Secrets and set as environment
|
|
variables in the [test-plugin-example.yml](/.github/workflows/test-plugin-example.yml) file. Example:
|
|
|
|
```yml
|
|
- name: Build
|
|
working-directory: ${{ github.event.inputs.folder }}
|
|
run: PACKER_LOG=${{ github.event.inputs.logs }} packer build .
|
|
env:
|
|
AUTH_KEY: ${{ secrets.AUTH_KEY }}
|
|
AUTH_PASSWORD: ${{ secrets.AUTH_PASSWORD }}
|
|
``` |