Skip to content

Commit

Permalink
Merge pull request #7 from dawitnida/fix/README
Browse files Browse the repository at this point in the history
Update README with more details for validate action.
  • Loading branch information
dawitnida authored Apr 4, 2019
2 parents 5397138 + 6909f3b commit e0bdab8
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 4 deletions.
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ Check out the [official Packer documentation][packer-doc] for further reference.

## Getting started and 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" {
resolves = "packer-validate"
Expand All @@ -29,11 +35,45 @@ action "filter-open-synced-pr" {
args = "action 'opened|synchronize'"
}
### For single template (eg. Dockers dir contains *.json template)
action "packer-validate" {
uses = "dawitnida/packer-github-actions/validate@master"
needs = "filter-open-synced-pr"
secrets = [
"GITHUB_TOKEN",
]
env = {
PACKER_ACTION_WORKING_DIR = "Dockers"
TEMPLATE_FILE_NAME = "*.json"
}
}
### For specific template file (eg. Dockers dir contains *.json template)
action "packer-validate" {
uses = "dawitnida/packer-github-actions/validate@master"
needs = "filter-open-synced-pr"
secrets = [
"GITHUB_TOKEN",
]
env = {
TEMPLATE_FILE_NAME = "sample-packer-template.json"
}
}
### For specific template file (eg. sample-packer-template.json) with var-file arg
action "packer-validate" {
uses = "dawitnida/packer-github-actions/validate@master"
needs = "filter-open-synced-pr"
secrets = ["GITHUB_TOKEN"]
args = "*.json"
secrets = [
"GITHUB_TOKEN",
]
args = [
"-syntax-only",
"-var-file=global-vars.json"
]
env = {
TEMPLATE_FILE_NAME = "sample-packer-template.json"
}
}
```

Expand Down
44 changes: 42 additions & 2 deletions validate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Check out the [packer validate command][packer-validate-doc] for further referen

## 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" {
resolves = "packer-validate"
Expand All @@ -17,11 +23,45 @@ action "filter-open-synced-pr" {
args = "action 'opened|synchronize'"
}
### For single template (eg. Dockers dir contains *.json template)
action "packer-validate" {
uses = "dawitnida/packer-github-actions/validate@master"
needs = "filter-open-synced-pr"
secrets = [
"GITHUB_TOKEN",
]
env = {
PACKER_ACTION_WORKING_DIR = "Dockers"
TEMPLATE_FILE_NAME = "*.json"
}
}
### For specific template file (eg. Dockers dir contains *.json template)
action "packer-validate" {
uses = "dawitnida/packer-github-actions/validate@master"
needs = "filter-open-synced-pr"
secrets = [
"GITHUB_TOKEN",
]
env = {
TEMPLATE_FILE_NAME = "sample-packer-template.json"
}
}
### For specific template file (eg. sample-packer-template.json) with var-file arg
action "packer-validate" {
uses = "dawitnida/packer-github-actions/validate@master"
needs = "filter-open-synced-pr"
secrets = ["GITHUB_TOKEN"]
args = "*.json"
secrets = [
"GITHUB_TOKEN",
]
args = [
"-syntax-only",
"-var-file=global-vars.json"
]
env = {
TEMPLATE_FILE_NAME = "sample-packer-template.json"
}
}
```

Expand Down

0 comments on commit e0bdab8

Please sign in to comment.