An open API service indexing awesome lists of open source software.

https://github.com/dawitnida/packer-actions-demo

Packer template collection
https://github.com/dawitnida/packer-actions-demo

git github github-action github-actions hashicorp packer packer-template packer-validate

Last synced: 23 days ago
JSON representation

Packer template collection

Awesome Lists containing this project

README

        

# Packer GitHub Actions Tester
Packer sample template collections for [Packer GitHub Actions][packer-gh-actions] testing.

### Usage

Variables

- `PACKER_ACTION_WORKING_DIR` : Working directory
- `TEMPLATE_FILE_NAME` : Packer template file
- `ACTION_COMMENT` : Enable/Disable PR comment from validate result

```
workflow "packer validate docker-image-template" {
resolves = "packer-validate-docker-image-template"
on = "pull_request"
}

action "filter-open-synced-pr" {
uses = "actions/bin/filter@master"
args = "action 'opened|synchronize'"
}

action "packer-validate-docker-image-template" {
uses = "dawitnida/packer-github-actions/validate@master"
needs = "filter-open-synced-pr"
secrets = [
"GITHUB_TOKEN",
]
env = {
TEMPLATE_FILE_NAME = "*.json"
PACKER_ACTION_WORKING_DIR = "dockers"
}
}

workflow "packer validate template-x with var-file" {
resolves = "packer-validate-template-x"
on = "pull_request"
}

action "packer-validate-template-x" {
uses = "dawitnida/packer-github-actions/validate@master"
needs = "filter-open-synced-pr"
secrets = [
"GITHUB_TOKEN",
]
args = [
"-var-file=global-vars.json",
]
env = {
TEMPLATE_FILE_NAME = "packer-template-x.json"
}
}

workflow "packer validate template-y without arg" {
resolves = "packer-validate-template-y"
on = "pull_request"
}

action "packer-validate-template-y" {
uses = "dawitnida/packer-github-actions/validate@master"
needs = "filter-open-synced-pr"
secrets = [
"GITHUB_TOKEN",
]
env = {
TEMPLATE_FILE_NAME = "packer-template-y.json"
}
}
```

## Author
[Dawit Nida](https://github.com/dawitnida)

[packer-gh-actions]: