fiftyone.geolocation 4.3.1 → 4.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ci/common-ci/.github/labels.yml +24 -1
- package/ci/common-ci/.github/workflows/sync-labels.yml +2 -0
- package/ci/common-ci/CiTips.md +30 -1
- package/ci/common-ci/README.md +73 -12
- package/ci/common-ci/build-and-test.yml +6 -1
- package/ci/common-ci/cloud-release-config.json +51 -0
- package/ci/common-ci/dotnet/shared-extract-and-publish-packages.yml +1 -5
- package/ci/common-ci/go/shared-go-list-stage.yml +64 -0
- package/ci/common-ci/java/readme.md +15 -1
- package/ci/common-ci/php/readme.md +15 -0
- package/ci/common-ci/release-config-schema.json +52 -0
- package/ci/common-ci/release-config-template.json +50 -1
- package/ci/common-ci/release-config.json +47 -189
- package/ci/common-ci/scripts/azure/checkSlot.ps1 +28 -0
- package/ci/common-ci/scripts/modules/51DAuthorizationModule/51DAuthorizationModule.psm1 +12 -5
- package/ci/common-ci/scripts/modules/51DDeployModule/51DDeployModule.psm1 +66 -0
- package/ci/common-ci/scripts/modules/51DDownloadDataFileModule/51DDownloadDataFileModule.psm1 +58 -0
- package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.psm1 +8 -8
- package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.Tests.ps1 +347 -9
- package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.psm1 +285 -54
- package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.Tests.ps1 +9 -8
- package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.psm1 +30 -13
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.Tests.ps1 +342 -97
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.psm1 +36 -2
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/SharedVariables.psm1 +2 -2
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-deploy-test-env-config.json +290 -0
- package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-test-env-config.json +260 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DApplicationInsightsModule/51DApplicationInsightsModule.psm1 +104 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DChecksModule/51DChecksModule.psm1 +68 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DCloudModule/51DCloudModule.psm1 +155 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DConnectAzureModule/51DConnectAzureModule.psm1 +45 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DSSLBindingsModule/51DSSLBIndingsModule.psm1 +100 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DStagingSlotModule/51DStagingSlotModule.psm1 +50 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DStorageAccountModule/51DStorageAccountModule.psm1 +248 -0
- package/ci/common-ci/scripts/modules/AzurePortalModules/51DTrafficManagerModule/51DTrafficManagerModule.psm1 +58 -0
- package/ci/common-ci/shared-auto-complete-pr-stage.yml +16 -3
- package/ci/common-ci/shared-create-tag-job.yml +9 -0
- package/ci/common-ci/shared-docker-build-steps.yml +34 -0
- package/ci/common-ci/shared-docker-push-steps.yml +32 -0
- package/ci/common-ci/shared-docker-test-http-steps.yml +69 -0
- package/ci/common-ci/shared-git-version-job.yml +17 -2
- package/ci/common-ci/shared-publish-github-stage.yml +54 -51
- package/ci/common-ci/shared-submodule-trigger-stage.yml +56 -4
- package/ci/shared-build-and-test-stage.yml +5 -2
- package/examples/examples.test.js +3 -3
- package/geoLocationPipelineBuilder.js +9 -16
- package/package.json +11 -7
- package/setup.js +1 -0
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"repositories": {
|
|
3
3
|
"common-ci": {
|
|
4
|
-
"version": "4.3.
|
|
4
|
+
"version": "4.3.18",
|
|
5
5
|
"isLeaf": true
|
|
6
6
|
},
|
|
7
|
+
"device-detection-data": {
|
|
8
|
+
"version": "4.3.1",
|
|
9
|
+
"isLeaf": false
|
|
10
|
+
},
|
|
7
11
|
"common-cxx": {
|
|
8
12
|
"version": "4.3.1",
|
|
9
13
|
"isLeaf": false,
|
|
@@ -12,142 +16,87 @@
|
|
|
12
16
|
]
|
|
13
17
|
},
|
|
14
18
|
"device-detection-cxx": {
|
|
15
|
-
"version": "4.3.
|
|
16
|
-
"isLeaf": false,
|
|
17
|
-
"dependencies": [
|
|
18
|
-
"common-ci",
|
|
19
|
-
"common-cxx"
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
"device-detection-varnish": {
|
|
23
|
-
"version": "4.3.0",
|
|
24
|
-
"isLeaf": false,
|
|
25
|
-
"dependencies": [
|
|
26
|
-
"common-ci",
|
|
27
|
-
"device-detection-cxx"
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
"device-detection-nginx": {
|
|
31
|
-
"version": "4.3.1",
|
|
19
|
+
"version": "4.3.8",
|
|
32
20
|
"isLeaf": false,
|
|
33
21
|
"dependencies": [
|
|
34
22
|
"common-ci",
|
|
35
|
-
"
|
|
23
|
+
"common-cxx",
|
|
24
|
+
"device-detection-data"
|
|
36
25
|
]
|
|
37
26
|
},
|
|
38
|
-
"pipeline-
|
|
39
|
-
"version": "4.3.
|
|
40
|
-
"packageName": "pipeline",
|
|
41
|
-
"versionVariableName": "pipeline.version",
|
|
27
|
+
"pipeline-php-core": {
|
|
28
|
+
"version": "4.3.4",
|
|
29
|
+
"packageName": "fiftyone.pipeline.core",
|
|
42
30
|
"isLeaf": false,
|
|
43
31
|
"dependencies": [
|
|
44
32
|
"common-ci"
|
|
45
33
|
]
|
|
46
34
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"isLeaf": false,
|
|
52
|
-
"dependencies": [
|
|
53
|
-
"common-ci",
|
|
54
|
-
"pipeline-java",
|
|
55
|
-
"device-detection-java"
|
|
56
|
-
]
|
|
57
|
-
},
|
|
58
|
-
"location-onpremise-java": {
|
|
59
|
-
"version": "4.3.0",
|
|
60
|
-
"packageName": "geo-location.digitalelement",
|
|
61
|
-
"versionVariableName": "geolocation.digitalelement.version",
|
|
62
|
-
"isLeaf": false,
|
|
63
|
-
"dependencies": [
|
|
64
|
-
"common-ci",
|
|
65
|
-
"pipeline-java",
|
|
66
|
-
"location-java"
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
"device-detection-java": {
|
|
70
|
-
"version": "4.3.0",
|
|
71
|
-
"packageName": "pipeline.device-detection",
|
|
72
|
-
"versionVariableName": "devicedetection.version",
|
|
35
|
+
|
|
36
|
+
"pipeline-php-engines": {
|
|
37
|
+
"version": "4.3.3",
|
|
38
|
+
"packageName": "fiftyone.pipeline.engines",
|
|
73
39
|
"isLeaf": false,
|
|
74
40
|
"dependencies": [
|
|
75
41
|
"common-ci",
|
|
76
|
-
"
|
|
77
|
-
"pipeline-java"
|
|
78
|
-
]
|
|
79
|
-
},
|
|
80
|
-
"common-dotnet": {
|
|
81
|
-
"version": "4.3.1",
|
|
82
|
-
"packageName": "FiftyOne.Common",
|
|
83
|
-
"isLeaf": false,
|
|
84
|
-
"dependencies": [
|
|
85
|
-
"common-ci"
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
"caching-dotnet": {
|
|
89
|
-
"version": "4.3.1",
|
|
90
|
-
"packageName": "FiftyOne.Caching",
|
|
91
|
-
"isLeaf": false,
|
|
92
|
-
"dependencies": [
|
|
93
|
-
"common-ci"
|
|
42
|
+
"pipeline-php-core"
|
|
94
43
|
]
|
|
95
44
|
},
|
|
96
|
-
"pipeline-
|
|
97
|
-
"version": "4.3.
|
|
98
|
-
"packageName": "
|
|
45
|
+
"pipeline-php-cloudrequestengine": {
|
|
46
|
+
"version": "4.3.4",
|
|
47
|
+
"packageName": "fiftyone.pipeline.cloudrequestengine",
|
|
99
48
|
"isLeaf": false,
|
|
100
49
|
"dependencies": [
|
|
101
50
|
"common-ci",
|
|
102
|
-
"
|
|
103
|
-
"
|
|
51
|
+
"pipeline-php-core",
|
|
52
|
+
"pipeline-php-engines"
|
|
104
53
|
]
|
|
105
54
|
},
|
|
106
|
-
"location-
|
|
107
|
-
|
|
108
|
-
"packageName": "
|
|
55
|
+
"location-php": {
|
|
56
|
+
"version": "4.3.3",
|
|
57
|
+
"packageName": "fiftyone.geolocation",
|
|
109
58
|
"isLeaf": false,
|
|
110
59
|
"dependencies": [
|
|
111
60
|
"common-ci",
|
|
112
|
-
"
|
|
113
|
-
"pipeline-
|
|
114
|
-
"
|
|
61
|
+
"pipeline-php-core",
|
|
62
|
+
"pipeline-php-engines",
|
|
63
|
+
"pipeline-php-cloudrequestengine",
|
|
64
|
+
"device-detection-php"
|
|
115
65
|
]
|
|
116
66
|
},
|
|
117
|
-
"device-detection-
|
|
118
|
-
"version": "4.3.
|
|
119
|
-
"packageName": "
|
|
67
|
+
"device-detection-php-onpremise": {
|
|
68
|
+
"version": "4.3.3",
|
|
69
|
+
"packageName": "fiftyone.devicedetection",
|
|
120
70
|
"isLeaf": false,
|
|
121
71
|
"dependencies": [
|
|
122
72
|
"common-ci",
|
|
123
73
|
"device-detection-cxx",
|
|
124
|
-
"
|
|
125
|
-
"pipeline-
|
|
74
|
+
"pipeline-php-core",
|
|
75
|
+
"pipeline-php-engines"
|
|
126
76
|
]
|
|
127
77
|
},
|
|
128
|
-
"
|
|
129
|
-
"version": "4.
|
|
78
|
+
"device-detection-php": {
|
|
79
|
+
"version": "4.3.3",
|
|
80
|
+
"packageName": "fiftyone.devicedetection",
|
|
130
81
|
"isLeaf": false,
|
|
131
82
|
"dependencies": [
|
|
132
83
|
"common-ci",
|
|
133
|
-
"
|
|
134
|
-
"pipeline-
|
|
84
|
+
"pipeline-php-core",
|
|
85
|
+
"pipeline-php-engines",
|
|
86
|
+
"pipeline-php-cloudrequestengine"
|
|
135
87
|
]
|
|
136
88
|
},
|
|
137
|
-
"
|
|
138
|
-
"version": "
|
|
139
|
-
"packageName": "
|
|
140
|
-
"isLeaf": false,
|
|
89
|
+
"pipeline-wordpress": {
|
|
90
|
+
"version": "1.0.1",
|
|
91
|
+
"packageName": "fiftyonedegrees.wordpress",
|
|
92
|
+
"isLeaf": false,
|
|
141
93
|
"dependencies": [
|
|
142
94
|
"common-ci",
|
|
143
|
-
"
|
|
144
|
-
"pipeline-dotnet",
|
|
145
|
-
"device-detection-dotnet",
|
|
146
|
-
"location-dotnet"
|
|
95
|
+
"pipeline-php-cloudrequestengine"
|
|
147
96
|
]
|
|
148
97
|
},
|
|
149
98
|
"pipeline-node": {
|
|
150
|
-
"version": "4.3.
|
|
99
|
+
"version": "4.3.5",
|
|
151
100
|
"packageName": "fiftyone.pipeline",
|
|
152
101
|
"isLeaf": false,
|
|
153
102
|
"dependencies": [
|
|
@@ -155,7 +104,7 @@
|
|
|
155
104
|
]
|
|
156
105
|
},
|
|
157
106
|
"location-node": {
|
|
158
|
-
"version": "4.3.
|
|
107
|
+
"version": "4.3.3",
|
|
159
108
|
"packageName": "fiftyone.geolocation",
|
|
160
109
|
"isLeaf": false,
|
|
161
110
|
"dependencies": [
|
|
@@ -165,7 +114,7 @@
|
|
|
165
114
|
]
|
|
166
115
|
},
|
|
167
116
|
"device-detection-node": {
|
|
168
|
-
"version": "4.3.
|
|
117
|
+
"version": "4.3.3",
|
|
169
118
|
"packageName": "fiftyone.devicedetection",
|
|
170
119
|
"isLeaf": false,
|
|
171
120
|
"dependencies": [
|
|
@@ -173,97 +122,6 @@
|
|
|
173
122
|
"device-detection-cxx",
|
|
174
123
|
"pipeline-node"
|
|
175
124
|
]
|
|
176
|
-
},
|
|
177
|
-
"pipeline-python": {
|
|
178
|
-
"version": "4.3.1",
|
|
179
|
-
"packageName": "fiftyone_pipeline",
|
|
180
|
-
"versionVariableName": "pipelineVersion",
|
|
181
|
-
"isLeaf": false,
|
|
182
|
-
"dependencies": [
|
|
183
|
-
"common-ci"
|
|
184
|
-
]
|
|
185
|
-
},
|
|
186
|
-
"location-python": {
|
|
187
|
-
"version": "4.3.0",
|
|
188
|
-
"packageName": "fiftyone_location",
|
|
189
|
-
"versionVariableName": "locationVersion",
|
|
190
|
-
"isLeaf": false,
|
|
191
|
-
"dependencies": [
|
|
192
|
-
"common-ci",
|
|
193
|
-
"pipeline-python"
|
|
194
|
-
]
|
|
195
|
-
},
|
|
196
|
-
"device-detection-python": {
|
|
197
|
-
"version": "4.3.0",
|
|
198
|
-
"packageName": "fiftyone_devicedetection",
|
|
199
|
-
"versionVariableName": "deviceDetectionVersion",
|
|
200
|
-
"isLeaf": false,
|
|
201
|
-
"dependencies": [
|
|
202
|
-
"common-ci",
|
|
203
|
-
"device-detection-cxx",
|
|
204
|
-
"pipeline-python"
|
|
205
|
-
]
|
|
206
|
-
},
|
|
207
|
-
"pipeline-php-core": {
|
|
208
|
-
"version": "4.3.1",
|
|
209
|
-
"packageName": "fiftyone.pipeline.core",
|
|
210
|
-
"isLeaf": false,
|
|
211
|
-
"dependencies": [
|
|
212
|
-
"common-ci"
|
|
213
|
-
]
|
|
214
|
-
},
|
|
215
|
-
"pipeline-php-engines": {
|
|
216
|
-
"version": "4.3.1",
|
|
217
|
-
"packageName": "fiftyone.pipeline.engines",
|
|
218
|
-
"isLeaf": false,
|
|
219
|
-
"dependencies": [
|
|
220
|
-
"common-ci",
|
|
221
|
-
"pipeline-php-core"
|
|
222
|
-
]
|
|
223
|
-
},
|
|
224
|
-
"pipeline-php-cloudrequestengine": {
|
|
225
|
-
"version": "4.3.1",
|
|
226
|
-
"packageName": "fiftyone.pipeline.cloudrequestengine",
|
|
227
|
-
"isLeaf": false,
|
|
228
|
-
"dependencies": [
|
|
229
|
-
"common-ci",
|
|
230
|
-
"pipeline-php-core",
|
|
231
|
-
"pipeline-php-engines"
|
|
232
|
-
]
|
|
233
|
-
},
|
|
234
|
-
"location-php": {
|
|
235
|
-
"version": "4.3.1",
|
|
236
|
-
"packageName": "fiftyone.geolocation",
|
|
237
|
-
"isLeaf": false,
|
|
238
|
-
"dependencies": [
|
|
239
|
-
"common-ci",
|
|
240
|
-
"pipeline-php-core",
|
|
241
|
-
"pipeline-php-engines",
|
|
242
|
-
"pipeline-php-cloudrequestengine",
|
|
243
|
-
"device-detection-php"
|
|
244
|
-
]
|
|
245
|
-
},
|
|
246
|
-
"device-detection-php-onpremise": {
|
|
247
|
-
"version": "4.3.1",
|
|
248
|
-
"packageName": "fiftyone.devicedetection",
|
|
249
|
-
"isLeaf": false,
|
|
250
|
-
"dependencies": [
|
|
251
|
-
"common-ci",
|
|
252
|
-
"device-detection-cxx",
|
|
253
|
-
"pipeline-php-core",
|
|
254
|
-
"pipeline-php-engines"
|
|
255
|
-
]
|
|
256
|
-
},
|
|
257
|
-
"device-detection-php": {
|
|
258
|
-
"version": "4.3.1",
|
|
259
|
-
"packageName": "fiftyone.devicedetection",
|
|
260
|
-
"isLeaf": false,
|
|
261
|
-
"dependencies": [
|
|
262
|
-
"common-ci",
|
|
263
|
-
"pipeline-php-core",
|
|
264
|
-
"pipeline-php-engines",
|
|
265
|
-
"pipeline-php-cloudrequestengine"
|
|
266
|
-
]
|
|
267
125
|
}
|
|
268
126
|
},
|
|
269
127
|
"approvalRequired": false
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# This is a wrapper script which runs the Get-SlotStatus function in the
|
|
2
|
+
# 51DDeployModule, helpful if running from azure pipelines and need to pass in
|
|
3
|
+
# arguments.
|
|
4
|
+
|
|
5
|
+
param (
|
|
6
|
+
# The path to the module folder which contains the 51DeployModule. This
|
|
7
|
+
# module contains the Get-SlotStatus function.
|
|
8
|
+
[Parameter(Mandatory=$true)]
|
|
9
|
+
[string]$ModulePath,
|
|
10
|
+
|
|
11
|
+
# The URI of the service to test, e.g. https://51degrees.com
|
|
12
|
+
[Parameter(Mandatory=$true)]
|
|
13
|
+
[string]$Uri,
|
|
14
|
+
|
|
15
|
+
# The number of tries before aborting the test.
|
|
16
|
+
[int]$NumberOfTries=18,
|
|
17
|
+
|
|
18
|
+
# The delay between tries in seconds.
|
|
19
|
+
[int]$SecondsBetweenTries=10
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
# Install all modules
|
|
23
|
+
$Env:PSModulePath += "$([IO.Path]::PathSeparator)$($ModulePath)"
|
|
24
|
+
Write-Host "Module Path: $($Env:PSModulePath)"
|
|
25
|
+
|
|
26
|
+
# Execute Get-SlotStatus script. The function will exit with a status of 1 if
|
|
27
|
+
# the service fails to respond with a HTTP 200 status code.
|
|
28
|
+
Get-SlotStatus -Uri $Uri -NumberOfTries $NumberOfTries -SecondsBetweenTries $SecondsBetweenTries
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
# Get the path to the script parent folder.
|
|
2
|
+
$scriptPath = Split-Path -parent $MyInvocation.MyCommand.Definition
|
|
3
|
+
|
|
1
4
|
# Class contains definition of authorization string.
|
|
2
5
|
class Authorization {
|
|
3
|
-
|
|
4
|
-
# When using this script locally,
|
|
5
|
-
#
|
|
6
|
+
static [string]$AuthorizationString = "Bearer $Env:SYSTEM_ACCESSTOKEN"
|
|
7
|
+
# When using this script locally, create a authorization -setting.json with the following content:
|
|
8
|
+
# { "Base64PAT": "Basic [Your Base 64 PAT]" }
|
|
9
|
+
# Update it with your base 64 encoded PAT as described at
|
|
6
10
|
# https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=preview-page#use-a-pat
|
|
7
|
-
#
|
|
8
|
-
|
|
11
|
+
#
|
|
12
|
+
# Then uncomment the following line, load this module and run 'Using module 51DAuthorizationModule' in a fresh environment if
|
|
13
|
+
# accessing this directly from a terminal.
|
|
14
|
+
#
|
|
15
|
+
# static [string]$AuthorizationString = $(Get-Content $scriptPath/authorization-settings.json -Raw | Out-String | ConvertFrom-Json).Base64PAT
|
|
9
16
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<#
|
|
2
|
+
==================== Deploy =====================
|
|
3
|
+
.Description
|
|
4
|
+
This module contains functions to aid with deployment to Azure Services.
|
|
5
|
+
#>
|
|
6
|
+
|
|
7
|
+
# Get HTTP status where querying a Uri, return even if the client throws an
|
|
8
|
+
# exception.
|
|
9
|
+
function Get-StatusCode {
|
|
10
|
+
|
|
11
|
+
param(
|
|
12
|
+
[string]$Uri
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
try{
|
|
16
|
+
(Invoke-WebRequest -Uri $Uri -UseBasicParsing -DisableKeepAlive).StatusCode
|
|
17
|
+
}
|
|
18
|
+
catch [Net.WebException]
|
|
19
|
+
{
|
|
20
|
+
[int]$_.Exception.Response.StatusCode
|
|
21
|
+
}
|
|
22
|
+
catch [Exception]
|
|
23
|
+
{
|
|
24
|
+
return 0
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
# Check if a service has started by polling an endoint, if the number of retrys
|
|
29
|
+
# has been exhausted and the service is not running (no 200 status code returned)
|
|
30
|
+
# then exit with status code 1.
|
|
31
|
+
function Get-SlotStatus {
|
|
32
|
+
param (
|
|
33
|
+
# The URI of the service to test, e.g. https://51degrees.com
|
|
34
|
+
[Parameter(Mandatory=$true)]
|
|
35
|
+
[string]$Uri,
|
|
36
|
+
|
|
37
|
+
# The number of tries before aborting the test.
|
|
38
|
+
[Parameter(Mandatory=$true)]
|
|
39
|
+
[int]$NumberOfTries,
|
|
40
|
+
|
|
41
|
+
# The delay between tries in seconds.
|
|
42
|
+
[Parameter(Mandatory=$true)]
|
|
43
|
+
[int]$SecondsBetweenTries
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# Wait for the service to start
|
|
47
|
+
Write-Host -NoNewline "Waiting for response from $Uri "
|
|
48
|
+
|
|
49
|
+
$Tries = 0
|
|
50
|
+
$HTTP_Status = Get-StatusCode -Uri $Uri -Path $Path
|
|
51
|
+
While ($HTTP_Status -ne 200 -And $Tries -le $NumberOfTries) {
|
|
52
|
+
Start-Sleep -Seconds $SecondsBetweenTries
|
|
53
|
+
$Tries = $Tries +1
|
|
54
|
+
$HTTP_Status = Get-StatusCode -Uri $Uri -Path $Path
|
|
55
|
+
Write-Host -NoNewLine "."
|
|
56
|
+
}
|
|
57
|
+
Write-Host ""
|
|
58
|
+
# Exit if service is not accepting requests
|
|
59
|
+
if($HTTP_Status -ne 200) {
|
|
60
|
+
Write-Host "Service is not accepting requests."
|
|
61
|
+
exit 1
|
|
62
|
+
}
|
|
63
|
+
Write-Host "Service has started"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
Export-ModuleMember -Function Get-SlotStatus
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<#
|
|
2
|
+
==================== Download =====================
|
|
3
|
+
.Description
|
|
4
|
+
This module contains a function to download a data file
|
|
5
|
+
from the 51Degrees Distributor.
|
|
6
|
+
#>
|
|
7
|
+
|
|
8
|
+
# Download a data file.
|
|
9
|
+
function Get-DataFile {
|
|
10
|
+
|
|
11
|
+
param (
|
|
12
|
+
[Parameter(Mandatory=$true)]
|
|
13
|
+
[string]$licenseKey,
|
|
14
|
+
|
|
15
|
+
[Parameter(Mandatory=$true)]
|
|
16
|
+
[string]$dataType,
|
|
17
|
+
|
|
18
|
+
[Parameter(Mandatory=$true)]
|
|
19
|
+
[string]$product,
|
|
20
|
+
|
|
21
|
+
[Parameter(Mandatory=$true)]
|
|
22
|
+
[string]$fullFilePath
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
$timeoutWebclientCode = @"
|
|
26
|
+
using System.Net;
|
|
27
|
+
|
|
28
|
+
public class TimeoutWebClient : WebClient
|
|
29
|
+
{
|
|
30
|
+
public int TimeoutSeconds;
|
|
31
|
+
|
|
32
|
+
protected override WebRequest GetWebRequest(System.Uri address)
|
|
33
|
+
{
|
|
34
|
+
WebRequest request = base.GetWebRequest(address);
|
|
35
|
+
if (request != null)
|
|
36
|
+
{
|
|
37
|
+
request.Timeout = TimeoutSeconds * 1000;
|
|
38
|
+
}
|
|
39
|
+
return request;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public TimeoutWebClient()
|
|
43
|
+
{
|
|
44
|
+
TimeoutSeconds = 100; // Timeout value by default
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
"@;
|
|
48
|
+
|
|
49
|
+
Add-Type -TypeDefinition $timeoutWebclientCode -Language CSharp
|
|
50
|
+
$webClient = New-Object TimeoutWebClient;
|
|
51
|
+
$webClient.TimeoutSeconds = 240;
|
|
52
|
+
$url ="https://distributor.51degrees.com/api/v2/download?LicenseKeys=$($licenseKey)&Type=$($dataType)&Download=True&Product=$($product)"
|
|
53
|
+
$start_time = Get-Date
|
|
54
|
+
$webClient.DownloadFile($url, $fullFilePath)
|
|
55
|
+
Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
Export-ModuleMember -Function Get-DataFile
|
|
@@ -591,16 +591,16 @@ function Update-SubmoduleReferences {
|
|
|
591
591
|
$targetTag = $script:repositories."$subRepoName".version
|
|
592
592
|
Write-Host "# Checking tag $targetTag"
|
|
593
593
|
|
|
594
|
-
# Get all tag
|
|
595
|
-
Write-Host "# Fetch all tags"
|
|
596
|
-
if (![GitHandler]::FetchAllTags()) {
|
|
597
|
-
Write-Host "# ERROR: Failed to fetch tags. Cannot reliably check submodule deployment."
|
|
598
|
-
Pop-Location
|
|
599
|
-
return $false
|
|
600
|
-
}
|
|
601
|
-
|
|
602
594
|
$tagUpdated = $false
|
|
603
595
|
if ($targetTag -ne $null) {
|
|
596
|
+
# Get all tag
|
|
597
|
+
Write-Host "# Fetch all tags"
|
|
598
|
+
if (![GitHandler]::FetchAllTags()) {
|
|
599
|
+
Write-Host "# ERROR: Failed to fetch tags. Cannot reliably check submodule deployment."
|
|
600
|
+
Pop-Location
|
|
601
|
+
return $false
|
|
602
|
+
}
|
|
603
|
+
|
|
604
604
|
$remoteRepo = git -c http.extraheader="AUTHORIZATION: $([Authorization]::AuthorizationString)" config --get remote.origin.url
|
|
605
605
|
Write-Host "# Remote repository found '$remoteRepo'"
|
|
606
606
|
# Make sure to sort the tag, so only pick up the biggest tag.
|