-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathtask.json
More file actions
158 lines (158 loc) · 9.9 KB
/
task.json
File metadata and controls
158 lines (158 loc) · 9.9 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{
"id": "37dda93c-8427-4372-9b7b-9b6e10f3f744",
"name": "AWSPowerShellModuleScript",
"friendlyName": "AWS Tools for Windows PowerShell Script",
"description": "Run a PowerShell script that uses the AWS Tools for Windows PowerShell module.",
"author": "Amazon Web Services",
"helpMarkDown": "Run a PowerShell script that uses cmdlets from the [AWS Tools for Windows PowerShell module (AWSPowerShell)](https://www.powershellgallery.com/packages/AWSPowerShell) module. The module will be automatically installed if needed.\n\nMore information on this task can be found in the [task reference](https://docs.aws.amazon.com/vsts/latest/userguide/awspowershell-module-script.html).\n\n####Task Permissions\nPermissions for this task to call AWS service APIs depend on the activities in the supplied script.",
"category": "Deploy",
"visibility": ["Build", "Release"],
"demands": ["DotNetFramework"],
"minimumAgentVersion": "2.144.0",
"instanceNameFormat": "AWS Tools for Windows PowerShell Script: $(scriptFile)",
"showEnvironmentVariables": true,
"groups": [
{
"name": "advanced",
"displayName": "Advanced",
"isExpanded": false
}
],
"inputs": [
{
"name": "awsCredentials",
"type": "connectedService:AWS",
"label": "AWS Credentials",
"defaultValue": "",
"required": false,
"helpMarkDown": "Specifies the AWS credentials to be used by the task in the build agent environment.\n\nYou can specify credentials using a service endpoint (of type _AWS_) in the task configuration or you can leave unspecified. If unspecified the task will attempt to obtain credentials from the following sources in order:\n\n* From task variables named _AWS.AccessKeyID_, _AWS.SecretAccessKey_ and optionally _AWS.SessionToken_.\n* From credentials set in environment variables in the build agent process. When using environment variables in the build agent process you may use the standard AWS environment variables: _AWS_ACCESS_KEY_ID_, _AWS_SECRET_ACCESS_KEY_ and optionally _AWS_SESSION_TOKEN_.\n* If the build agent is running on an Amazon EC2 instance, from the instance metadata associated with the EC2 instance. For credentials to be available from EC2 instance metadata the instance must have been started with an instance profile referencing a role granting permissions to the task to make calls to AWS on your behalf. See [Using an IAM Role to Grant Permissions to Applications Running on Amazon EC2 Instances](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) for more information."
},
{
"name": "regionName",
"label": "AWS Region",
"type": "pickList",
"required": false,
"defaultValue": "",
"helpMarkDown": "The AWS region code (us-east-1, us-west-2 etc) of the region containing the AWS resource(s) the task will use or create. For more information see [AWS Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html).\n\nIf a region is not explicitly configured the task will attempt to obtain the region to be used from the following sources:\n\n* From a task variable named _AWS.Region_.\n* From the standard AWS environment variable _AWS_REGION_ in the build agent's environment.\n* If the build agent is running on an Amazon EC2 instance, from instance metadata associated with the EC2 instance.\n\n__Note:__ The regions listed in the picker are those known at the time this software was released. New regions that are not listed may still be used by entering the _region code_ of the region (for example _us_west_2_).",
"options": {},
"properties": {
"EditableOptions": "True"
}
},
{
"name": "arguments",
"type": "string",
"label": "Arguments",
"defaultValue": "",
"required": false,
"helpMarkDown": "Optional arguments to pass to the script. You can specify either ordinal or named parameters."
},
{
"name": "scriptType",
"type": "radio",
"label": "Script Source",
"defaultValue": "filePath",
"required": false,
"helpMarkDown": "The source of the script to run. You can choose a file containing the script or enter the script in the task's configuration.",
"options": {
"filePath": "Script file",
"inline": "Inline Script"
}
},
{
"name": "filePath",
"type": "filePath",
"label": "Script Path",
"defaultValue": "",
"required": true,
"visibleRule": "scriptType = filePath",
"helpMarkDown": "The path of the script file to execute. Must be a fully qualified path or relative to $(System.DefaultWorkingDirectory)."
},
{
"name": "inlineScript",
"type": "multiLine",
"label": "Inline Script",
"defaultValue": "# You can write your powershell script inline here (the AWSPowerShell module will be imported automatically).\n\n Write-Host \"Hello World\"",
"required": true,
"helpMarkDown": "The script to execute.",
"visibleRule": "scriptType = inline",
"properties": {
"resizable": "true",
"rows": "10",
"maxLength": "5000"
}
},
{
"name": "errorActionPreference",
"type": "pickList",
"label": "ErrorActionPreference",
"required": false,
"defaultValue": "stop",
"options": {
"stop": "Stop",
"continue": "Continue",
"silentlyContinue": "SilentlyContinue"
},
"helpMarkDown": "Prepends the line `$ErrorActionPreference = 'VALUE'` at the top of your script."
},
{
"name": "failOnStderr",
"type": "boolean",
"label": "Fail on Standard Error",
"required": false,
"defaultValue": "false",
"helpMarkDown": "If this is true, this task will fail if any errors are written to the error pipeline, or if any data is written to the Standard Error stream. Otherwise the task will rely on the exit code to determine failure.",
"groupName": "advanced"
},
{
"name": "ignoreLASTEXITCODE",
"type": "boolean",
"label": "Ignore $LASTEXITCODE",
"required": false,
"defaultValue": "false",
"helpMarkDown": "If this is false, the line `if ((Test-Path -LiteralPath variable:\\LASTEXITCODE)) { exit $LASTEXITCODE }` is appended to the end of your script. This will cause the last exit code from an external command to be propagated as the exit code of powershell. Otherwise the line is not appended to the end of your script.",
"groupName": "advanced"
},
{
"name": "workingDirectory",
"type": "filePath",
"label": "Working Directory",
"required": false,
"defaultValue": "",
"helpMarkDown": "The working directory where the script is run.",
"groupName": "advanced"
}
],
"execution": {
"PowerShell3": {
"target": "RunAWSPowerShellModuleScript.ps1",
"platforms": ["windows"]
}
},
"messages": {
"GeneratingScript": "Generating script.",
"TestingAWSModuleInstalled": "Checking install status for AWS Tools for Windows PowerShell module.",
"ModularAWSModuleFound": "AWS.Tools.Common found. Assuming all needed AWS.Tools modules are already installed.",
"SecurityTokenModuleNotFound": "AWS.Tools.SecurityToken module not found. You will not be able to use a service connection specifying a role ARN.",
"AWSModuleNotFound": "AWS Tools for Windows PowerShell module not found.",
"InstallingAWSModule": "Installing AWS Tools for Windows PowerShell module to current user scope",
"ConfiguringRegionFromTaskConfiguration": "Region discovered from task configuration",
"ConfiguringRegionFromTaskVariable": "Region discovered from task variable",
"RegionConfiguredTo": "...task region set to {0}.",
"PS_ExitCode": "PowerShell exited with code '{0}'.",
"PS_FormattedCommand": "Formatted command: {0}",
"PS_InvalidErrorActionPreference": "Invalid ErrorActionPreference '{0}'. The value must be one of: 'Stop', 'Continue', or 'SilentlyContinue'.",
"PS_InvalidFilePath": "Invalid file path '{0}'. A path to a .ps1 file is required.",
"PS_InvalidWorkingDirectory": "Invalid working directory path '{0}'.",
"PS_UnableToDetermineExitCode": "Unexpected exception. Unable to determine the exit code from powershell.",
"ConfiguringProxy": "Configuring proxy for AWSPowerShell module. Host {0}, port {1}",
"ProxyConfigError": "Failed to configure proxy, error {0}",
"SkippingProxyConfigDueToAgentVersion": "Agent version {0} does not meet minumum {1} for proxy configuration; skipping auto-detection of proxy settings.",
"CheckingForProxyConfiguration": "Attempting to detect proxy settings to configure tool",
"ConfiguringForRoleCredentials": "Configuring task to use role-scoped credentials from specified endpoint",
"ConfiguringForStandardCredentials": "Configuring task for standard AWS credentials from specified endpoint",
"ConfiguringForRoleCredentialsFromOIDC": "Configuring task to use role-scoped credentials with OIDC token",
"ConfiguringForTaskVariableCredentials": "Configuring task for standard AWS credentials from task variables",
"MissingSecretKeyVariable": "AWS access key ID present in task variables but secret key value is missing; cannot configure task credentials"
}
}