fiftyone.geolocation 4.2.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.
Files changed (109) hide show
  1. package/.gitmodules +3 -0
  2. package/README.md +2 -2
  3. package/ci/README.md +2 -0
  4. package/ci/build-and-test.yml +34 -0
  5. package/ci/common-ci/.github/labels.yml +59 -0
  6. package/ci/common-ci/.github/workflows/sync-labels.yml +49 -0
  7. package/ci/common-ci/CiTips.md +34 -0
  8. package/ci/common-ci/GitVersion.yml +18 -0
  9. package/ci/common-ci/LICENSE +286 -0
  10. package/ci/common-ci/README.md +365 -0
  11. package/ci/common-ci/build-and-test.yml +65 -0
  12. package/ci/common-ci/check-merge-commit-format.yml +50 -0
  13. package/ci/common-ci/cloud-release-config.json +51 -0
  14. package/ci/common-ci/create-tag.yml +41 -0
  15. package/ci/common-ci/deploy.yml +25 -0
  16. package/ci/common-ci/dotnet/shared-code-signing-steps.yml +20 -0
  17. package/ci/common-ci/dotnet/shared-extract-and-publish-packages.yml +29 -0
  18. package/ci/common-ci/go/shared-go-list-stage.yml +64 -0
  19. package/ci/common-ci/java/readme.md +22 -0
  20. package/ci/common-ci/java/shared-code-signing-steps.yml +17 -0
  21. package/ci/common-ci/node/shared-extract-and-publish-packages.yml +26 -0
  22. package/ci/common-ci/php/readme.md +15 -0
  23. package/ci/common-ci/release-config-schema.json +52 -0
  24. package/ci/common-ci/release-config-template.json +310 -0
  25. package/ci/common-ci/release-config.json +128 -0
  26. package/ci/common-ci/release-process.drawio +165 -0
  27. package/ci/common-ci/release-process.png +0 -0
  28. package/ci/common-ci/scripts/azure/checkSlot.ps1 +28 -0
  29. package/ci/common-ci/scripts/modules/51DAuthorizationModule/51DAuthorizationModule.Tests.ps1 +1 -0
  30. package/ci/common-ci/scripts/modules/51DAuthorizationModule/51DAuthorizationModule.psm1 +16 -0
  31. package/ci/common-ci/scripts/modules/51DBuildModule/51DBuildModule.Tests.ps1 +3 -0
  32. package/ci/common-ci/scripts/modules/51DBuildModule/51DBuildModule.psm1 +200 -0
  33. package/ci/common-ci/scripts/modules/51DDeployModule/51DDeployModule.psm1 +66 -0
  34. package/ci/common-ci/scripts/modules/51DDownloadDataFileModule/51DDownloadDataFileModule.psm1 +58 -0
  35. package/ci/common-ci/scripts/modules/51DEnvironmentModule/51DEnvironmentModule.Tests.ps1 +25 -0
  36. package/ci/common-ci/scripts/modules/51DEnvironmentModule/51DEnvironmentModule.psm1 +22 -0
  37. package/ci/common-ci/scripts/modules/51DErrorHandleModule/51DErrorHandleModule.Tests.ps1 +1 -0
  38. package/ci/common-ci/scripts/modules/51DErrorHandleModule/51DErrorHandleModule.psm1 +41 -0
  39. package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.Tests.ps1 +5 -0
  40. package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.psm1 +698 -0
  41. package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.Tests.ps1 +842 -0
  42. package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.psm1 +926 -0
  43. package/ci/common-ci/scripts/modules/51DPipelineModule/51DPipelineModule.Tests.ps1 +1 -0
  44. package/ci/common-ci/scripts/modules/51DPipelineModule/51DPipelineModule.psm1 +87 -0
  45. package/ci/common-ci/scripts/modules/51DPullRequestModule/51DPullRequestModule.Tests.ps1 +194 -0
  46. package/ci/common-ci/scripts/modules/51DPullRequestModule/51DPullRequestModule.psm1 +653 -0
  47. package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.Tests.ps1 +277 -0
  48. package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.psm1 +554 -0
  49. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.Tests.ps1 +1141 -0
  50. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.psd1 +0 -0
  51. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.psm1 +1465 -0
  52. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ConfigurationVerifier.Tests.ps1 +318 -0
  53. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ConfigurationVerifier.psm1 +344 -0
  54. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.Tests.ps1 +1186 -0
  55. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.psm1 +900 -0
  56. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/SharedVariables.psm1 +139 -0
  57. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/c-test-env-config.json +268 -0
  58. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/dotnet-deploy-test-env-config.json +700 -0
  59. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/dotnet-test-env-config.json +533 -0
  60. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-deploy-test-env-config.json +290 -0
  61. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-test-env-config.json +260 -0
  62. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/java-deploy-test-env-config.json +511 -0
  63. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/java-test-env-config.json +388 -0
  64. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/node-deploy-test-env-config.json +419 -0
  65. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/node-test-env-config.json +329 -0
  66. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/php-test-env-config.json +540 -0
  67. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/python-deploy-test-env-config.json +411 -0
  68. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/python-test-env-config.json +321 -0
  69. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/test-env-config.json +457 -0
  70. package/ci/common-ci/scripts/modules/51DRestModule/51DRestModule.psm1 +38 -0
  71. package/ci/common-ci/scripts/modules/AzurePortalModules/51DApplicationInsightsModule/51DApplicationInsightsModule.psm1 +104 -0
  72. package/ci/common-ci/scripts/modules/AzurePortalModules/51DChecksModule/51DChecksModule.psm1 +68 -0
  73. package/ci/common-ci/scripts/modules/AzurePortalModules/51DCloudModule/51DCloudModule.psm1 +155 -0
  74. package/ci/common-ci/scripts/modules/AzurePortalModules/51DConnectAzureModule/51DConnectAzureModule.psm1 +45 -0
  75. package/ci/common-ci/scripts/modules/AzurePortalModules/51DSSLBindingsModule/51DSSLBIndingsModule.psm1 +100 -0
  76. package/ci/common-ci/scripts/modules/AzurePortalModules/51DStagingSlotModule/51DStagingSlotModule.psm1 +50 -0
  77. package/ci/common-ci/scripts/modules/AzurePortalModules/51DStorageAccountModule/51DStorageAccountModule.psm1 +248 -0
  78. package/ci/common-ci/scripts/modules/AzurePortalModules/51DTrafficManagerModule/51DTrafficManagerModule.psm1 +58 -0
  79. package/ci/common-ci/shared-auto-complete-pr-stage.yml +61 -0
  80. package/ci/common-ci/shared-create-tag-job.yml +23 -0
  81. package/ci/common-ci/shared-docker-build-steps.yml +34 -0
  82. package/ci/common-ci/shared-docker-push-steps.yml +32 -0
  83. package/ci/common-ci/shared-docker-test-http-steps.yml +69 -0
  84. package/ci/common-ci/shared-git-tag-job.yml +38 -0
  85. package/ci/common-ci/shared-git-version-job.yml +71 -0
  86. package/ci/common-ci/shared-publish-github-stage.yml +107 -0
  87. package/ci/common-ci/shared-submodule-trigger-stage.yml +110 -0
  88. package/ci/common-ci/shared-variables.yml +3 -0
  89. package/ci/common-ci/trigger-release-apis.yml +39 -0
  90. package/ci/create-packages.yml +109 -0
  91. package/ci/deploy-external.yml +55 -0
  92. package/ci/deploy-internal.yml +50 -0
  93. package/ci/shared-build-and-test-platforms.yml +26 -0
  94. package/ci/shared-build-and-test-stage.yml +128 -0
  95. package/ci/shared-variables.yml +7 -0
  96. package/ci/submodule-trigger.yml +12 -0
  97. package/docs/Doxyfile +3 -3
  98. package/docs/DoxygenLayout.xml +1 -1
  99. package/examples/examples.test.js +3 -3
  100. package/geoLocationPipelineBuilder.js +16 -13
  101. package/package.json +14 -6
  102. package/setup.js +1 -0
  103. package/tests/geoLocationCloud.test.js +192 -0
  104. package/tsconfig.json +21 -0
  105. package/types/geoLocationCloud.d.ts +7 -0
  106. package/types/geoLocationPipelineBuilder.d.ts +17 -0
  107. package/types/index.d.ts +2 -0
  108. package/build-and-test.yml +0 -112
  109. package/publish-packages.yml +0 -87
@@ -24,6 +24,40 @@ const GeoLocation = require(__dirname +
24
24
  '/..');
25
25
  const myResourceKey = process.env.RESOURCE_KEY || '!!YOUR_RESOURCE_KEY!!';
26
26
 
27
+ const TestLat = '51.4578261';
28
+ const TestLon = '-0.975922996290084';
29
+ const expectedProperties = {
30
+ location: [
31
+ 'javascript',
32
+ 'building',
33
+ 'streetnumber',
34
+ 'road',
35
+ 'town',
36
+ // For some reason, the value of the 'county' property returned
37
+ // by the call to the cloud is always null on the build agent,
38
+ // despite working correctly locally.
39
+ // After spending the best part of a day trying to resolve this,
40
+ // we've decided to exclude the county property from this test
41
+ // for the moment.
42
+ // 'county',
43
+ 'region',
44
+ 'state',
45
+ 'zipcode',
46
+ 'country',
47
+ 'countrycode'
48
+ ],
49
+ location_digitalelement: [
50
+ 'javascript',
51
+ 'town',
52
+ 'county',
53
+ 'region',
54
+ 'state',
55
+ 'zipcode',
56
+ 'country',
57
+ 'countrycode'
58
+ ]
59
+ };
60
+
27
61
  // Skip the rest of the examples when async is not available
28
62
  let isAsync = true;
29
63
 
@@ -58,7 +92,165 @@ if (isAsync) {
58
92
  done();
59
93
  });
60
94
  });
95
+
96
+ test('Available Properties 51Degrees', async done => {
97
+ if (myResourceKey === '!!YOUR_RESOURCE_KEY!!') {
98
+ throw new Error('No resource key is present!');
99
+ }
100
+
101
+ const pipeline = new GeoLocation.GeoLocationPipelineBuilder({
102
+ resourceKey: myResourceKey,
103
+ locationProvider: 'fiftyonedegrees'
104
+ }).build();
105
+ var engine = pipeline.flowElements.location;
106
+
107
+ await testAvailableProperties(done, pipeline, engine);
108
+ });
109
+
110
+ test('Available Properties Digital Element', async done => {
111
+ if (myResourceKey === '!!YOUR_RESOURCE_KEY!!') {
112
+ throw new Error('No resource key is present!');
113
+ }
114
+
115
+ const pipeline = new GeoLocation.GeoLocationPipelineBuilder({
116
+ resourceKey: myResourceKey,
117
+ locationProvider: 'digitalelement'
118
+ }).build();
119
+ var engine = pipeline.flowElements.location_digitalelement;
120
+
121
+ await testAvailableProperties(done, pipeline, engine);
122
+ });
123
+
124
+ test('Value Types 51Degrees', async done => {
125
+ if (myResourceKey === '!!YOUR_RESOURCE_KEY!!') {
126
+ throw new Error('No resource key is present!');
127
+ }
128
+
129
+ const pipeline = new GeoLocation.GeoLocationPipelineBuilder({
130
+ resourceKey: myResourceKey,
131
+ locationProvider: 'fiftyonedegrees'
132
+ }).build();
133
+ var engine = pipeline.flowElements.location;
134
+
135
+ await testValueTypes(done, pipeline, engine);
136
+ });
137
+
138
+ test('Value Types DigitalElement', async done => {
139
+ if (myResourceKey === '!!YOUR_RESOURCE_KEY!!') {
140
+ throw new Error('No resource key is present!');
141
+ }
142
+
143
+ const pipeline = new GeoLocation.GeoLocationPipelineBuilder({
144
+ resourceKey: myResourceKey,
145
+ locationProvider: 'digitalelement'
146
+ }).build();
147
+ var engine = pipeline.flowElements.location_digitalelement;
148
+
149
+ await testValueTypes(done, pipeline, engine);
150
+ });
61
151
  } else {
62
152
  // Skip if async is not available (e.g node 6)
63
153
  test.skip('Workaround', () => 1);
64
154
  }
155
+
156
+ async function testAvailableProperties (done, pipeline, engine) {
157
+ const flowData = pipeline.createFlowData();
158
+
159
+ flowData.evidence.add('query.51D_Pos_latitude', TestLat);
160
+ flowData.evidence.add('query.51D_Pos_longitude', TestLon);
161
+
162
+ await flowData.process();
163
+
164
+ expectedProperties[engine.dataKey].forEach(key => {
165
+ try {
166
+ var apv = flowData[engine.dataKey][key];
167
+ if (apv === undefined) {
168
+ done.fail(new Error(`Aspect property value for ${key} should not be undefined.`));
169
+ }
170
+ expect(apv).not.toBeNull();
171
+ expect(apv).toBeDefined();
172
+ if (apv.hasValue === true) {
173
+ if (apv.value == null || apv.value === undefined) {
174
+ done.fail(new Error(`${key}.value should not be null`));
175
+ }
176
+ } else {
177
+ if (apv.noValueMessage == null || apv.noValueMessage === undefined) {
178
+ done.fail(new Error(`${key}.noValueMessage should not be null`));
179
+ }
180
+ }
181
+ } catch (err) {
182
+ done.fail(err);
183
+ }
184
+ });
185
+ done();
186
+ }
187
+
188
+ async function testValueTypes (done, pipeline, engine) {
189
+ const flowData = pipeline.createFlowData();
190
+
191
+ flowData.evidence.add('query.51D_Pos_latitude', TestLat);
192
+ flowData.evidence.add('query.51D_Pos_longitude', TestLon);
193
+
194
+ await flowData.process();
195
+
196
+ Object.keys(engine.properties).forEach(key => {
197
+ if (expectedProperties[engine.dataKey].includes(key)) {
198
+ var property = engine.properties[key.toLowerCase()];
199
+ var expectedType = property.type;
200
+ var apv = flowData[engine.dataKey][key];
201
+
202
+ expect(apv).not.toBeNull();
203
+ expect(apv).toBeDefined();
204
+ expect(apv.hasValue, 'No value for \'' + key + '\'. (' + apv.noValueMessage + ')').toBe(true);
205
+ expect(apv.value).toBe51DType(key, expectedType);
206
+ }
207
+ });
208
+
209
+ done();
210
+ }
211
+
212
+ expect.extend({
213
+ // Method to validate a given value has the expected type.
214
+ toBe51DType (received, name, fodType) {
215
+ var valueType = typeof received;
216
+ var valid = false;
217
+
218
+ switch (fodType) {
219
+ case 'Boolean':
220
+ valid = valueType === 'boolean';
221
+ break;
222
+ case 'String':
223
+ valid = valueType === 'string';
224
+ break;
225
+ case 'JavaScript':
226
+ valid = valueType === 'string';
227
+ break;
228
+ case 'Int32':
229
+ valid = valueType === 'number';
230
+ break;
231
+ case 'Double':
232
+ valid = valueType === 'number';
233
+ break;
234
+ case 'Array':
235
+ valid = valueType === 'object' && Array.isArray(received);
236
+ break;
237
+ default:
238
+ valid = false;
239
+ break;
240
+ }
241
+
242
+ if (valid) {
243
+ return {
244
+ message: () =>
245
+ `${name}: expected node type '${valueType}' not to be equivalent to fodType '${fodType}' for value: '${received}'`,
246
+ pass: true
247
+ };
248
+ } else {
249
+ return {
250
+ message: () =>
251
+ `${name}: expected node type '${valueType}' to be equivalent to fodType '${fodType}' for value: '${received}'`,
252
+ pass: false
253
+ };
254
+ }
255
+ }
256
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ // Change this to match your project
3
+ "include": ["*"],
4
+ "compilerOptions": {
5
+ // Tells TypeScript to read JS files, as
6
+ // normally they are ignored as source files
7
+ "allowJs": true,
8
+ // Generate d.ts files
9
+ "declaration": true,
10
+ // This compiler run should
11
+ // only output d.ts files
12
+ "emitDeclarationOnly": true,
13
+ // Types should go into this directory.
14
+ // Removing this would place the .d.ts files
15
+ // next to the .js files
16
+ "outDir": "types",
17
+ "lib": ["ES2015"],
18
+ "moduleResolution": "Node",
19
+ "noImplicitAny": true
20
+ }
21
+ }
@@ -0,0 +1,7 @@
1
+ export = GeoLocationCloud;
2
+ declare const GeoLocationCloud_base: typeof import("fiftyone.pipeline.cloudrequestengine/types/cloudEngine");
3
+ declare class GeoLocationCloud extends GeoLocationCloud_base {
4
+ constructor({ locationProvider }: {
5
+ locationProvider: any;
6
+ }, ...args: any[]);
7
+ }
@@ -0,0 +1,17 @@
1
+ export = GeoLocationPipelineBuilder;
2
+ declare const GeoLocationPipelineBuilder_base: typeof import("fiftyone.pipeline.core/types/pipelineBuilder");
3
+ declare class GeoLocationPipelineBuilder extends GeoLocationPipelineBuilder_base {
4
+ /**
5
+ * Extension of pipelineBuilder class that allows for the quick generation of a geo-location pipeline. Adds share usage, caching with simple paramater changes
6
+ * @param {Object} options
7
+ * @param {Boolean} options.shareUsage // include share usage element?
8
+ * @param {String} options.resourceKey // resourceKey for cloud
9
+ * @param {String} options.locationProvider // the provider to request data from. Either "fiftyonedegrees" or "digitalelement".
10
+ *
11
+ */
12
+ constructor({ shareUsage, resourceKey, locationProvider, baseURL }: {
13
+ shareUsage: boolean;
14
+ resourceKey: string;
15
+ locationProvider: string;
16
+ }, ...args: any[]);
17
+ }
@@ -0,0 +1,2 @@
1
+ export const GeoLocationCloud: typeof import("./geoLocationCloud");
2
+ export const GeoLocationPipelineBuilder: typeof import("./geoLocationPipelineBuilder");
@@ -1,112 +0,0 @@
1
- trigger: none
2
-
3
- pr:
4
- - master
5
- - develop
6
- - release/*
7
-
8
- pool:
9
- vmImage: 'ubuntu-latest'
10
-
11
- variables:
12
- - group: InternalKeys
13
-
14
- strategy:
15
- matrix:
16
- node_10_x:
17
- node_version: 10.x
18
- node_12_x:
19
- node_version: 12.x
20
- node_14_x:
21
- node_version: 14.x
22
-
23
- steps:
24
- - checkout: self
25
- lfs: true
26
- submodules: recursive
27
-
28
- - task: NodeTool@0
29
- inputs:
30
- versionSpec: $(node_version)
31
- displayName: 'Install Node.js'
32
-
33
- # The secure file to download will be stored in the
34
- # Pipelines/Library/SecureFiles section in Azure DevOps.
35
- - task: DownloadSecureFile@1
36
- displayName: 'Download .npmrc'
37
- name: npmrc
38
- inputs:
39
- secureFile: '.npmrc'
40
-
41
- - task: CopyFiles@2
42
- displayName: 'Copy .npmrc to working directory'
43
- inputs:
44
- sourceFolder: '$(Agent.TempDirectory)'
45
- targetFolder: '$(System.DefaultWorkingDirectory)'
46
- contents: '.npmrc'
47
-
48
- # 1. Set resource key environment variable from location resource key value
49
- # in 'InternalKeys' group
50
- # 2. Install dependencies.
51
- # 3. Run tests.
52
- - script: |
53
- echo "Resource key for testing = $(LocationResourceKey)"
54
- export RESOURCE_KEY="$(LocationResourceKey)"
55
- npm install
56
- npm install fiftyone.devicedetection
57
- npm test
58
- displayName: 'Build and Test'
59
-
60
- - script: |
61
- eslint='{
62
- "env": {
63
- "browser": true,
64
- "commonjs": true,
65
- "es6": true
66
- },
67
- "extends": [
68
- "standard"
69
- ],
70
- "globals": {
71
- "Atomics": "readonly",
72
- "SharedArrayBuffer": "readonly",
73
- "test": true,
74
- "jest": true,
75
- "expect": true,
76
- "resourceKey": true
77
- },
78
- "parserOptions": {
79
- "ecmaVersion": 2018
80
- },
81
- "rules": {
82
- "node/no-deprecated-api": "off",
83
- "no-throw-literal": "off",
84
- "no-path-concat": "off",
85
- "no-prototype-builtins": "off",
86
- "no-eval": "off",
87
- "semi": [
88
- 2,
89
- "always"
90
- ]
91
- }
92
- }'
93
- echo $eslint
94
- echo $eslint > .eslintrc
95
- npm install -g eslint@6.8.0
96
- eslint **/*.js
97
- displayName: "Set up and run eslint"
98
- condition: ne(variables['node_version'], '6.x')
99
-
100
- - task: PublishTestResults@2
101
- condition: succeededOrFailed()
102
- inputs:
103
- testRunner: JUnit
104
- testResultsFiles: '**/test_results.xml'
105
- testRunTitle: 'Node $(node_version)'
106
-
107
- - task: PublishCodeCoverageResults@1
108
- inputs:
109
- codeCoverageTool: Cobertura
110
- summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'
111
- reportDirectory: '$(System.DefaultWorkingDirectory)/**/coverage'
112
-
@@ -1,87 +0,0 @@
1
- trigger:
2
- - master
3
- - develop
4
- - release/*
5
-
6
- pool:
7
- vmImage: 'ubuntu-latest'
8
-
9
- variables:
10
- - group: PackageFeedAccessToken
11
- # Access token for the git repository. Used by the git tag task.
12
- - name: system_accesstoken
13
- value: $(System.AccessToken)
14
-
15
- steps:
16
- # The lines below are needed to allow the pipeline access to the
17
- # OAuth access token that controls write access to the git repository.
18
- # (Required for GitTag task)
19
- - checkout: self
20
- lfs: true
21
- submodules: recursive
22
- persistCredentials: true
23
-
24
- - task: gittools.gitversion.gitversion-task.GitVersion@5
25
- displayName: 'Determine Version Number'
26
- # Give this task a name so we can use the variables it sets later.
27
- name: GitVersion
28
- inputs:
29
- preferBundledVersion: false
30
-
31
- # Set version number.
32
- - task: Npm@1
33
- displayName: 'npm version fiftyone.geolocation'
34
- inputs:
35
- command: 'custom'
36
- workingDir: '$(System.DefaultWorkingDirectory)'
37
- verbose: true
38
- customCommand: 'version --no-git-tag-version $(GitVersion.SemVer)'
39
- continueOnError: true
40
- condition: succeededOrFailed()
41
-
42
- # Create packages
43
- - script: |
44
- npm pack
45
- displayName: 'Create npm package for later release'
46
- condition: succeededOrFailed()
47
-
48
- # Copy artifacts contents.
49
- - task: CopyFiles@2
50
- inputs:
51
- sourceFolder: '$(Build.SourcesDirectory)'
52
- contents: '**/*.tgz'
53
- targetFolder: $(Build.ArtifactStagingDirectory)/npm
54
- displayName: 'Copy tgz files'
55
- condition: succeededOrFailed()
56
-
57
- - task: CopyFiles@2
58
- inputs:
59
- sourceFolder: '$(Build.SourcesDirectory)'
60
- contents: '**/package.json'
61
- targetFolder: $(Build.ArtifactStagingDirectory)/npm
62
- displayName: 'Copy package.json files'
63
- condition: succeededOrFailed()
64
-
65
- - script: |
66
- ls $(Build.ArtifactStagingDirectory)/**/*
67
- displayName: 'List artifact staging contents'
68
- condition: succeededOrFailed()
69
-
70
- # Add a tag to the git repository with the version number of
71
- # the package that has just been published
72
- - task: ATP.ATP-GitTag.GitTag.GitTag@5
73
- displayName: 'Tag Repo With Version Number'
74
- inputs:
75
- tagUser: 'Azure DevOps'
76
- tagEmail: 'CIUser@51Degrees.com'
77
- # Only create the tag if we also published a package as defined in
78
- # the previous task.
79
- condition: succeeded()
80
-
81
- # Publish artifacts to DevOps
82
- - task: PublishBuildArtifacts@1
83
- inputs:
84
- pathtoPublish: '$(Build.ArtifactStagingDirectory)/npm'
85
- artifactName: npm
86
- displayName: 'Publish npm artifact'
87
- condition: succeededOrFailed()