Skip to content

Commit

Permalink
Merge branch 'release/v0.3.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
rucciva committed Nov 12, 2020
2 parents 9e909ce + eda5ed9 commit 29fd9f5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ resource "linux_script" "install_package" {
PACKAGE_NAME = "apache2"
PACKAGE_VERSION = "2.4.18-2ubuntu3.4"
}
triggers = {
PACKAGE_NAME = "apache2"
}
}
```

Expand Down
3 changes: 3 additions & 0 deletions docs/resources/script.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ resource "linux_script" "install_package" {
PACKAGE_NAME = "apache2"
PACKAGE_VERSION = "2.4.18-2ubuntu3.4"
}
triggers = {
PACKAGE_NAME = "apache2"
}
}
```

Expand Down
36 changes: 20 additions & 16 deletions linux/script-resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ const (
attrScriptLifecycleCommandRead = "read"
attrScriptLifecycleCommandUpdate = "update"
attrScriptLifecycleCommandDelete = "delete"
attrScriptTriggers = "triggers"
attrScriptEnvironment = "environment"
attrScriptSensitiveEnvironment = "sensitive_environment"
attrScriptInterpreter = "interpreter"
attrScriptWorkingDirectory = "working_directory"
attrScriptDirty = "dirty"
attrScriptReadFailed = "read_failed"
attrScriptOutput = "output"

attrScriptTriggers = "triggers"
attrScriptEnvironment = "environment"
attrScriptSensitiveEnvironment = "sensitive_environment"
attrScriptWorkingDirectory = "working_directory"

attrScriptOutput = "output"

attrScriptDirty = "__dirty__"
attrScriptReadFailed = "__read_failed__"
)

var schemaScriptResource = map[string]*schema.Schema{
Expand Down Expand Up @@ -59,6 +62,14 @@ var schemaScriptResource = map[string]*schema.Schema{
},
},
},
attrScriptInterpreter: {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},

attrScriptTriggers: {
Type: schema.TypeMap,
Optional: true,
Expand All @@ -75,13 +86,6 @@ var schemaScriptResource = map[string]*schema.Schema{
Elem: schema.TypeString,
Sensitive: true,
},
attrScriptInterpreter: {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
attrScriptWorkingDirectory: {
Type: schema.TypeString,
Optional: true,
Expand All @@ -97,13 +101,13 @@ var schemaScriptResource = map[string]*schema.Schema{
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "`true` if new output is different than previous output. User must not manually set it to `true`",
Description: "`true` if new output is different than previous output. User must not manually set this to `true`",
},
attrScriptReadFailed: {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "`true` if read operation result in execution error. User must not manually set it to `true`",
Description: "`true` if read operation result in execution error. User must not manually set this to `true`",
},
}

Expand Down

0 comments on commit 29fd9f5

Please sign in to comment.