-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(output_file): add option to specify the test result output file
- Loading branch information
1 parent
fb262d8
commit d7c0606
Showing
9 changed files
with
146 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
example/packer_cache | ||
example/packer_cache | ||
.envrc | ||
packer-plugin-goss | ||
tests/debug-goss-spec.yaml | ||
tests/goss-spec.yaml | ||
tests/goss.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
default: help | ||
|
||
.PHONY: help | ||
help: ## list makefile targets | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: fmt | ||
fmt: ## format go files | ||
gofumpt -w . | ||
gci write . | ||
|
||
.PHONY: build | ||
build: ## build the plugin | ||
go build -ldflags="-X github.com/YaleUniversity/packer-provisioner-goss/version.VersionPrerelease=dev" -o packer-plugin-goss | ||
|
||
.PHONY: install | ||
install: ## install the plugin | ||
packer plugins install --path packer-plugin-goss github.com/YaleUniversity/goss | ||
|
||
.PHONY: local | ||
local: clean build install ## build and install the plugin locally | ||
cd tests && packer init . | ||
cd tests && packer build local.pkr.hcl | ||
|
||
.PHONY: clean | ||
clean: ## remove tmp files | ||
rm -f packer-plugin-goss tests/goss.json tests/debug-goss-spec.yaml tests/goss-spec.yaml packer-plugin-goss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
process: | ||
sshd: | ||
running: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
packer { | ||
required_version = ">= 1.9.0" | ||
|
||
required_plugins { | ||
goss = { | ||
version = "v0.0.1" | ||
source = "github.com/YaleUniversity/goss" | ||
} | ||
} | ||
} | ||
|
||
variable "ssh_user" { | ||
default = env("USER") | ||
} | ||
|
||
variable "ssh_password" { | ||
default = env("SSH_PASSWORD") | ||
} | ||
|
||
variable "ssh_host" { | ||
default = "127.0.0.1" | ||
} | ||
|
||
source "null" "local" { | ||
ssh_host = var.ssh_host | ||
ssh_username = var.ssh_user | ||
ssh_password = var.ssh_password | ||
} | ||
|
||
build { | ||
sources = ["null.local"] | ||
|
||
provisioner "goss" { | ||
download_path = "/tmp/goss_install" | ||
skip_install = true | ||
tests = ["./goss.yaml"] | ||
remote_path = "/tmp/goss" | ||
format = "junit" | ||
output_file = "/tmp/goss.json" | ||
} | ||
} |