fiftyone.geolocation 4.3.1 → 4.3.6
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/build-and-test.yml +5 -5
- package/ci/common-ci/.github/labels.yml +45 -1
- package/ci/common-ci/.github/workflows/sync-labels.yml +5 -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/c/shared-variables.yml +15 -0
- package/ci/common-ci/check-merge-commit-format.yml +7 -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/java/shared-package-signing-steps.yml +17 -0
- 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 +48 -123
- 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 +74 -0
- package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.psm1 +25 -21
- 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/common-ci/shared-variables.yml +5 -1
- package/ci/create-packages.yml +7 -7
- package/ci/deploy-external.yml +1 -1
- package/ci/deploy-internal.yml +1 -1
- package/ci/shared-build-and-test-stage.yml +5 -2
- package/ci/shared-variables.yml +1 -7
- package/examples/examples.test.js +3 -3
- package/geoLocationPipelineBuilder.js +9 -16
- package/package.json +11 -7
- package/setup.js +1 -0
- package/ci/common-ci/java/shared-code-signing-steps.yml +0 -17
|
@@ -1,42 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"repositories": {
|
|
3
3
|
"common-ci": {
|
|
4
|
-
"version": "4.3.
|
|
4
|
+
"version": "4.3.43",
|
|
5
5
|
"isLeaf": true
|
|
6
6
|
},
|
|
7
7
|
"common-cxx": {
|
|
8
|
-
"version": "4.3.
|
|
8
|
+
"version": "4.3.8",
|
|
9
9
|
"isLeaf": false,
|
|
10
10
|
"dependencies": [
|
|
11
11
|
"common-ci"
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
14
|
"device-detection-cxx": {
|
|
15
|
-
"version": "4.3.
|
|
15
|
+
"version": "4.3.13",
|
|
16
16
|
"isLeaf": false,
|
|
17
17
|
"dependencies": [
|
|
18
18
|
"common-ci",
|
|
19
19
|
"common-cxx"
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
|
-
"
|
|
23
|
-
"version": "4.3.
|
|
22
|
+
"pipeline-node": {
|
|
23
|
+
"version": "4.3.7",
|
|
24
|
+
"packageName": "fiftyone.pipeline",
|
|
25
|
+
"isLeaf": false,
|
|
26
|
+
"dependencies": [
|
|
27
|
+
"common-ci"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"location-node": {
|
|
31
|
+
"version": "4.3.6",
|
|
32
|
+
"packageName": "fiftyone.geolocation",
|
|
24
33
|
"isLeaf": false,
|
|
25
34
|
"dependencies": [
|
|
26
35
|
"common-ci",
|
|
27
|
-
"
|
|
36
|
+
"pipeline-node",
|
|
37
|
+
"device-detection-node"
|
|
28
38
|
]
|
|
29
39
|
},
|
|
30
|
-
"device-detection-
|
|
31
|
-
"version": "4.3.
|
|
40
|
+
"device-detection-node": {
|
|
41
|
+
"version": "4.3.10",
|
|
42
|
+
"packageName": "fiftyone.devicedetection",
|
|
32
43
|
"isLeaf": false,
|
|
33
44
|
"dependencies": [
|
|
34
45
|
"common-ci",
|
|
35
|
-
"device-detection-cxx"
|
|
46
|
+
"device-detection-cxx",
|
|
47
|
+
"pipeline-node"
|
|
36
48
|
]
|
|
37
49
|
},
|
|
38
50
|
"pipeline-java": {
|
|
39
|
-
"version": "4.3.
|
|
51
|
+
"version": "4.3.8",
|
|
40
52
|
"packageName": "pipeline",
|
|
41
53
|
"versionVariableName": "pipeline.version",
|
|
42
54
|
"isLeaf": false,
|
|
@@ -45,7 +57,7 @@
|
|
|
45
57
|
]
|
|
46
58
|
},
|
|
47
59
|
"location-java": {
|
|
48
|
-
"version": "4.3.
|
|
60
|
+
"version": "4.3.8",
|
|
49
61
|
"packageName": "pipeline.geo-location",
|
|
50
62
|
"versionVariableName": "geolocation.version",
|
|
51
63
|
"isLeaf": false,
|
|
@@ -55,30 +67,18 @@
|
|
|
55
67
|
"device-detection-java"
|
|
56
68
|
]
|
|
57
69
|
},
|
|
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
70
|
"device-detection-java": {
|
|
70
|
-
"version": "4.3.
|
|
71
|
+
"version": "4.3.13",
|
|
71
72
|
"packageName": "pipeline.device-detection",
|
|
72
73
|
"versionVariableName": "devicedetection.version",
|
|
73
74
|
"isLeaf": false,
|
|
74
75
|
"dependencies": [
|
|
75
76
|
"common-ci",
|
|
76
|
-
"device-detection-cxx"
|
|
77
|
-
"pipeline-java"
|
|
77
|
+
"device-detection-cxx"
|
|
78
78
|
]
|
|
79
79
|
},
|
|
80
80
|
"common-dotnet": {
|
|
81
|
-
"version": "4.3.
|
|
81
|
+
"version": "4.3.5",
|
|
82
82
|
"packageName": "FiftyOne.Common",
|
|
83
83
|
"isLeaf": false,
|
|
84
84
|
"dependencies": [
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
88
|
"caching-dotnet": {
|
|
89
|
-
"version": "4.3.
|
|
89
|
+
"version": "4.3.5",
|
|
90
90
|
"packageName": "FiftyOne.Caching",
|
|
91
91
|
"isLeaf": false,
|
|
92
92
|
"dependencies": [
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
]
|
|
95
95
|
},
|
|
96
96
|
"pipeline-dotnet": {
|
|
97
|
-
"version": "4.3.
|
|
97
|
+
"version": "4.3.15",
|
|
98
98
|
"packageName": "FiftyOne.Pipeline",
|
|
99
99
|
"isLeaf": false,
|
|
100
100
|
"dependencies": [
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
]
|
|
105
105
|
},
|
|
106
106
|
"location-dotnet": {
|
|
107
|
-
"version": "4.3.
|
|
107
|
+
"version": "4.3.11",
|
|
108
108
|
"packageName": "FiftyOne.Geolocation",
|
|
109
109
|
"isLeaf": false,
|
|
110
110
|
"dependencies": [
|
|
@@ -115,67 +115,37 @@
|
|
|
115
115
|
]
|
|
116
116
|
},
|
|
117
117
|
"device-detection-dotnet": {
|
|
118
|
-
"version": "4.3.
|
|
118
|
+
"version": "4.3.14",
|
|
119
119
|
"packageName": "FiftyOne.DeviceDetection",
|
|
120
120
|
"isLeaf": false,
|
|
121
121
|
"dependencies": [
|
|
122
122
|
"common-ci",
|
|
123
123
|
"device-detection-cxx",
|
|
124
|
+
"caching-dotnet",
|
|
124
125
|
"common-dotnet",
|
|
125
126
|
"pipeline-dotnet"
|
|
126
127
|
]
|
|
127
128
|
},
|
|
128
|
-
"
|
|
129
|
-
"version": "4.
|
|
130
|
-
"
|
|
131
|
-
"dependencies": [
|
|
132
|
-
"common-ci",
|
|
133
|
-
"common-dotnet",
|
|
134
|
-
"pipeline-dotnet"
|
|
135
|
-
]
|
|
136
|
-
},
|
|
137
|
-
"internal-engines-dotnet": {
|
|
138
|
-
"version": "4.3.0",
|
|
139
|
-
"packageName": "FiftyOne.GeoLocation.OnPremise",
|
|
140
|
-
"isLeaf": false,
|
|
141
|
-
"dependencies": [
|
|
142
|
-
"common-ci",
|
|
143
|
-
"common-dotnet",
|
|
144
|
-
"pipeline-dotnet",
|
|
145
|
-
"device-detection-dotnet",
|
|
146
|
-
"location-dotnet"
|
|
147
|
-
]
|
|
148
|
-
},
|
|
149
|
-
"pipeline-node": {
|
|
150
|
-
"version": "4.3.1",
|
|
151
|
-
"packageName": "fiftyone.pipeline",
|
|
129
|
+
"license-dotnet": {
|
|
130
|
+
"version": "4.3.3",
|
|
131
|
+
"packageName": "FiftyOne.(License|Resource)",
|
|
152
132
|
"isLeaf": false,
|
|
153
133
|
"dependencies": [
|
|
154
134
|
"common-ci"
|
|
155
135
|
]
|
|
156
136
|
},
|
|
157
|
-
"
|
|
158
|
-
|
|
159
|
-
"packageName": "fiftyone.geolocation",
|
|
160
|
-
"isLeaf": false,
|
|
161
|
-
"dependencies": [
|
|
162
|
-
"common-ci",
|
|
163
|
-
"pipeline-node",
|
|
164
|
-
"device-detection-node"
|
|
165
|
-
]
|
|
166
|
-
},
|
|
167
|
-
"device-detection-node": {
|
|
168
|
-
"version": "4.3.1",
|
|
169
|
-
"packageName": "fiftyone.devicedetection",
|
|
137
|
+
"entitlement-dotnet": {
|
|
138
|
+
"version": "4.1.18",
|
|
170
139
|
"isLeaf": false,
|
|
171
140
|
"dependencies": [
|
|
172
141
|
"common-ci",
|
|
173
|
-
"
|
|
174
|
-
"
|
|
142
|
+
"common-dotnet",
|
|
143
|
+
"license-dotnet",
|
|
144
|
+
"pipeline-dotnet"
|
|
175
145
|
]
|
|
176
146
|
},
|
|
177
147
|
"pipeline-python": {
|
|
178
|
-
"version": "4.3.
|
|
148
|
+
"version": "4.3.5",
|
|
179
149
|
"packageName": "fiftyone_pipeline",
|
|
180
150
|
"versionVariableName": "pipelineVersion",
|
|
181
151
|
"isLeaf": false,
|
|
@@ -184,7 +154,7 @@
|
|
|
184
154
|
]
|
|
185
155
|
},
|
|
186
156
|
"location-python": {
|
|
187
|
-
"version": "4.3.
|
|
157
|
+
"version": "4.3.2",
|
|
188
158
|
"packageName": "fiftyone_location",
|
|
189
159
|
"versionVariableName": "locationVersion",
|
|
190
160
|
"isLeaf": false,
|
|
@@ -194,7 +164,7 @@
|
|
|
194
164
|
]
|
|
195
165
|
},
|
|
196
166
|
"device-detection-python": {
|
|
197
|
-
"version": "4.3.
|
|
167
|
+
"version": "4.3.4",
|
|
198
168
|
"packageName": "fiftyone_devicedetection",
|
|
199
169
|
"versionVariableName": "deviceDetectionVersion",
|
|
200
170
|
"isLeaf": false,
|
|
@@ -204,65 +174,20 @@
|
|
|
204
174
|
"pipeline-python"
|
|
205
175
|
]
|
|
206
176
|
},
|
|
207
|
-
"
|
|
208
|
-
"version": "4.3.
|
|
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",
|
|
177
|
+
"device-detection-go": {
|
|
178
|
+
"version": "4.3.4",
|
|
227
179
|
"isLeaf": false,
|
|
228
180
|
"dependencies": [
|
|
229
181
|
"common-ci",
|
|
230
|
-
"
|
|
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"
|
|
182
|
+
"device-detection-cxx"
|
|
255
183
|
]
|
|
256
184
|
},
|
|
257
|
-
"device-detection-
|
|
258
|
-
"version": "4.3.
|
|
259
|
-
"packageName": "fiftyone.devicedetection",
|
|
185
|
+
"device-detection-examples-go": {
|
|
186
|
+
"version": "4.3.3",
|
|
260
187
|
"isLeaf": false,
|
|
261
188
|
"dependencies": [
|
|
262
189
|
"common-ci",
|
|
263
|
-
"
|
|
264
|
-
"pipeline-php-engines",
|
|
265
|
-
"pipeline-php-cloudrequestengine"
|
|
190
|
+
"device-detection-go"
|
|
266
191
|
]
|
|
267
192
|
}
|
|
268
193
|
},
|
|
@@ -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,74 @@
|
|
|
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
|
+
Add-Type -AssemblyName System.Net.Http
|
|
26
|
+
|
|
27
|
+
$webClient = New-Object System.Net.Http.HttpClient;
|
|
28
|
+
$webClient.Timeout = New-TimeSpan -Seconds 240
|
|
29
|
+
$url ="https://distributor.51degrees.com/api/v2/download?LicenseKeys=$($licenseKey)&Type=$($dataType)&Download=True&Product=$($product)"
|
|
30
|
+
$start_time = Get-Date
|
|
31
|
+
$complete = $false
|
|
32
|
+
$tryCount = 0
|
|
33
|
+
|
|
34
|
+
DO
|
|
35
|
+
{
|
|
36
|
+
$tryCount++;
|
|
37
|
+
Write-Host "Attempt: $tryCount"
|
|
38
|
+
|
|
39
|
+
try
|
|
40
|
+
{
|
|
41
|
+
# Get download stream
|
|
42
|
+
$stream = $webClient.GetStreamAsync($url)
|
|
43
|
+
$stream.ConfigureAwait($false) > $null
|
|
44
|
+
if ($null -ne $stream.Exception){ throw $stream.Exception }
|
|
45
|
+
|
|
46
|
+
# Save stream to path
|
|
47
|
+
try
|
|
48
|
+
{
|
|
49
|
+
$fileStream = [System.IO.File]::Create($fullFilePath)
|
|
50
|
+
$stream.Result.CopyTo($fileStream)
|
|
51
|
+
$complete = $true
|
|
52
|
+
}
|
|
53
|
+
finally
|
|
54
|
+
{
|
|
55
|
+
if ($null -ne $fileStream){ $fileStream.Dispose() }
|
|
56
|
+
if (($null -ne $stream) -and ($stream.IsCompleted -eq $true)){ $stream.Dispose() }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch
|
|
60
|
+
{
|
|
61
|
+
Write-Host "# ERROR downloading data file:"
|
|
62
|
+
Write-Host $_
|
|
63
|
+
}
|
|
64
|
+
} While (($complete -eq $false) -and ($tryCount -le 10))
|
|
65
|
+
|
|
66
|
+
if($complete -eq $false)
|
|
67
|
+
{
|
|
68
|
+
throw "# ERROR: Data file download failed after $tryCount attempts."
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
Export-ModuleMember -Function Get-DataFile
|
|
@@ -591,16 +591,18 @@ 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
|
+
$targetSpecified = $null -ne $targetTag
|
|
596
|
+
|
|
597
|
+
if ($targetSpecified) {
|
|
598
|
+
# Get all tag
|
|
599
|
+
Write-Host "# Fetch all tags"
|
|
600
|
+
if (![GitHandler]::FetchAllTags()) {
|
|
601
|
+
Write-Host "# ERROR: Failed to fetch tags. Cannot reliably check submodule deployment."
|
|
602
|
+
Pop-Location
|
|
603
|
+
return $false
|
|
604
|
+
}
|
|
605
|
+
|
|
604
606
|
$remoteRepo = git -c http.extraheader="AUTHORIZATION: $([Authorization]::AuthorizationString)" config --get remote.origin.url
|
|
605
607
|
Write-Host "# Remote repository found '$remoteRepo'"
|
|
606
608
|
# Make sure to sort the tag, so only pick up the biggest tag.
|
|
@@ -628,18 +630,20 @@ function Update-SubmoduleReferences {
|
|
|
628
630
|
}
|
|
629
631
|
|
|
630
632
|
Pop-Location
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
633
|
+
|
|
634
|
+
if($targetSpecified) {
|
|
635
|
+
# Exit if not all tags have been found.
|
|
636
|
+
if (!$tagUpdated) {
|
|
637
|
+
Write-Host "# ERROR: Failed to update Submodule $subRepoName to tag $targetTag."
|
|
638
|
+
return $false
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
# Stage the submodule update
|
|
642
|
+
Write-Host "# Stage the submodule $submodulePath"
|
|
643
|
+
if (![GitHandler]::Add($submodulePath)) {
|
|
644
|
+
Write-Host "# ERROR: Failed to stage the submodule $subRepoName."
|
|
645
|
+
return $false
|
|
646
|
+
}
|
|
643
647
|
}
|
|
644
648
|
} else {
|
|
645
649
|
Write-Host "# ERROR: Failed to extract module path from $submodulePath"
|