Skip to content

Commit

Permalink
Add use_raw_output config
Browse files Browse the repository at this point in the history
  • Loading branch information
dtan4 committed Dec 26, 2019
1 parent 58cc54e commit 9f7da26
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
9 changes: 5 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ type TypetalkNotifier struct {

// Terraform represents terraform configurations
type Terraform struct {
Default Default `yaml:"default"`
Fmt Fmt `yaml:"fmt"`
Plan Plan `yaml:"plan"`
Apply Apply `yaml:"apply"`
Default Default `yaml:"default"`
Fmt Fmt `yaml:"fmt"`
Plan Plan `yaml:"plan"`
Apply Apply `yaml:"apply"`
UseRawOutput bool `yaml:"use_raw_output,omitempty"`
}

// Default is a default setting for terraform commands
Expand Down
2 changes: 2 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func TestLoadFile(t *testing.T) {
Apply: Apply{
Template: "",
},
UseRawOutput: false,
},
path: "../example.tfnotify.yaml",
},
Expand Down Expand Up @@ -99,6 +100,7 @@ func TestLoadFile(t *testing.T) {
Apply: Apply{
Template: "",
},
UseRawOutput: false,
},
path: "../example-with-destroy.tfnotify.yaml",
},
Expand Down
21 changes: 21 additions & 0 deletions example-use-raw-output.tfnotify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ci: circleci
notifier:
github:
token: $GITHUB_TOKEN
repository:
owner: "mercari"
name: "tfnotify"
terraform:
use_raw_output: true
plan:
template: |
{{ .Title }}
{{ .Message }}
{{if .Result}}
<pre><code>{{ .Result }}
</pre></code>
{{end}}
<details><summary>Details (Click me)</summary>
<pre><code>{{ .Body }}
</pre></code></details>

0 comments on commit 9f7da26

Please sign in to comment.