-
Notifications
You must be signed in to change notification settings - Fork 65
/
schema_deploy_package_action.go
44 lines (36 loc) · 1.43 KB
/
schema_deploy_package_action.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package octopusdeploy
import (
"strings"
"github.com/OctopusDeploy/go-octopusdeploy/octopusdeploy"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func expandDeployPackageAction(flattenedAction map[string]interface{}) octopusdeploy.DeploymentAction {
action := expandAction(flattenedAction)
action.ActionType = "Octopus.TentaclePackage"
addWindowsServiceFeatureToActionResource(flattenedAction, action)
return action
}
func flattenDeployPackageAction(action octopusdeploy.DeploymentAction) map[string]interface{} {
flattenedAction := flattenAction(action)
if v, ok := action.Properties["Octopus.Action.EnabledFeatures"]; ok {
if strings.Contains(v.Value, "Octopus.Features.WindowsService") {
flattenedAction["windows_service"] = flattenWindowsService(action.Properties)
}
}
return flattenedAction
}
func getDeployPackageActionSchema() *schema.Schema {
actionSchema, element := getActionSchema()
addPrimaryPackageSchema(element, true)
// addCustomInstallationDirectoryFeature(element)
// addIisWebSiteAndApplicationPoolFeature(element)
addWindowsServiceFeature(element)
// addCustomDeploymentScriptsFeature(element)
// addJsonConfigurationVariablesFeature(element)
// addConfigurationVariablesFeature(element)
// addConfigurationTransformsFeature(element)
// addSubstituteVariablesInFilesFeature(element)
// addIis6HomeDirectoryFeature(element)
// addRedGateDatabaseDeploymentFeature(element)
return actionSchema
}