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.
Files changed (48) hide show
  1. package/ci/common-ci/.github/labels.yml +24 -1
  2. package/ci/common-ci/.github/workflows/sync-labels.yml +2 -0
  3. package/ci/common-ci/CiTips.md +30 -1
  4. package/ci/common-ci/README.md +73 -12
  5. package/ci/common-ci/build-and-test.yml +6 -1
  6. package/ci/common-ci/cloud-release-config.json +51 -0
  7. package/ci/common-ci/dotnet/shared-extract-and-publish-packages.yml +1 -5
  8. package/ci/common-ci/go/shared-go-list-stage.yml +64 -0
  9. package/ci/common-ci/java/readme.md +15 -1
  10. package/ci/common-ci/php/readme.md +15 -0
  11. package/ci/common-ci/release-config-schema.json +52 -0
  12. package/ci/common-ci/release-config-template.json +50 -1
  13. package/ci/common-ci/release-config.json +47 -189
  14. package/ci/common-ci/scripts/azure/checkSlot.ps1 +28 -0
  15. package/ci/common-ci/scripts/modules/51DAuthorizationModule/51DAuthorizationModule.psm1 +12 -5
  16. package/ci/common-ci/scripts/modules/51DDeployModule/51DDeployModule.psm1 +66 -0
  17. package/ci/common-ci/scripts/modules/51DDownloadDataFileModule/51DDownloadDataFileModule.psm1 +58 -0
  18. package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.psm1 +8 -8
  19. package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.Tests.ps1 +347 -9
  20. package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.psm1 +285 -54
  21. package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.Tests.ps1 +9 -8
  22. package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.psm1 +30 -13
  23. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.Tests.ps1 +342 -97
  24. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.psm1 +36 -2
  25. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/SharedVariables.psm1 +2 -2
  26. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-deploy-test-env-config.json +290 -0
  27. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-test-env-config.json +260 -0
  28. package/ci/common-ci/scripts/modules/AzurePortalModules/51DApplicationInsightsModule/51DApplicationInsightsModule.psm1 +104 -0
  29. package/ci/common-ci/scripts/modules/AzurePortalModules/51DChecksModule/51DChecksModule.psm1 +68 -0
  30. package/ci/common-ci/scripts/modules/AzurePortalModules/51DCloudModule/51DCloudModule.psm1 +155 -0
  31. package/ci/common-ci/scripts/modules/AzurePortalModules/51DConnectAzureModule/51DConnectAzureModule.psm1 +45 -0
  32. package/ci/common-ci/scripts/modules/AzurePortalModules/51DSSLBindingsModule/51DSSLBIndingsModule.psm1 +100 -0
  33. package/ci/common-ci/scripts/modules/AzurePortalModules/51DStagingSlotModule/51DStagingSlotModule.psm1 +50 -0
  34. package/ci/common-ci/scripts/modules/AzurePortalModules/51DStorageAccountModule/51DStorageAccountModule.psm1 +248 -0
  35. package/ci/common-ci/scripts/modules/AzurePortalModules/51DTrafficManagerModule/51DTrafficManagerModule.psm1 +58 -0
  36. package/ci/common-ci/shared-auto-complete-pr-stage.yml +16 -3
  37. package/ci/common-ci/shared-create-tag-job.yml +9 -0
  38. package/ci/common-ci/shared-docker-build-steps.yml +34 -0
  39. package/ci/common-ci/shared-docker-push-steps.yml +32 -0
  40. package/ci/common-ci/shared-docker-test-http-steps.yml +69 -0
  41. package/ci/common-ci/shared-git-version-job.yml +17 -2
  42. package/ci/common-ci/shared-publish-github-stage.yml +54 -51
  43. package/ci/common-ci/shared-submodule-trigger-stage.yml +56 -4
  44. package/ci/shared-build-and-test-stage.yml +5 -2
  45. package/examples/examples.test.js +3 -3
  46. package/geoLocationPipelineBuilder.js +9 -16
  47. package/package.json +11 -7
  48. package/setup.js +1 -0
@@ -16,6 +16,9 @@
16
16
  - name: "status: to be scheduled"
17
17
  description: This item has not been scheduled for a particular release
18
18
  color: c2e0c6
19
+ - name: "status: assigned"
20
+ description: This item has been assigned to an engineer
21
+ color: 6ff076
19
22
  - name: "status: duplicate"
20
23
  description: This issue or pull request already exists
21
24
  color: cfd3d7
@@ -31,6 +34,26 @@
31
34
  - name: "status: released/4.3.3"
32
35
  description: This change was released in the specified version
33
36
  color: 006b75
37
+ - name: "status: released/4.3.4"
38
+ description: This change was released in the specified version
39
+ color: 99ccff
40
+ - name: "status: released/4.3.5"
41
+ description: This change was released in the specified version
42
+ color: ccccff
43
+ - name: "status: released/4.3.6"
44
+ description: This change was released in the specified version
45
+ color: cc88ff
34
46
  - name: "status: released/4.4.0"
35
47
  description: This change was released in the specified version
36
- color: 376842
48
+ color: 376842
49
+
50
+ # Scheduled Labels
51
+ - name: "scheduled: 6th Oct 2021"
52
+ description: This item has been scheduled for 6th Oct 2021 release
53
+ color: 6ff076
54
+ - name: "scheduled: 20th Oct 2021"
55
+ description: This item has been scheduled for 20th Oct 2021 release
56
+ color: 6ff076
57
+ - name: "scheduled: 3rd Nov 2021"
58
+ description: This item has been scheduled for 3rd Nov 2021 release
59
+ color: 6ff076
@@ -19,6 +19,7 @@ jobs:
19
19
  manifest: .github/labels.yml
20
20
  repository: |
21
21
  51Degrees/caching-dotnet
22
+ 51Degrees/common-ci
22
23
  51Degrees/common-cxx
23
24
  51Degrees/data-file-tool
24
25
  51Degrees/device-detection-cxx
@@ -43,5 +44,6 @@ jobs:
43
44
  51Degrees/pipeline-php-core
44
45
  51Degrees/pipeline-php-engines
45
46
  51Degrees/pipeline-python
47
+ 51Degrees/pipeline-specification
46
48
  51Degrees/Renderer
47
49
  token: ${{ secrets.LABEL_SYNC_TOKEN }}
@@ -2,4 +2,33 @@
2
2
  ## Writing Script
3
3
  When writing script to perform a batch job, a common bug that happens often is not verifying if a step has successfully completed. There are many instances where an error code is not caught and is subsequently overwritten by the following steps, resulting in a false positive result. Therefore, when writing a script task, the following tips would help to minimize this risk:
4
4
  1. Always verify that the result of the script is as expected. Such as checking error code or checking if a certain conditions have been met. This can be done at a number of places in the script where a certain change could impact the final outcome.
5
- 2. Where a required condition was not met, log a message and exit with an appropriate non zero code. This will make sure the exit code will always be caught by the script task.
5
+ 2. Where a required condition was not met, log a message and exit with an appropriate non zero code. This will make sure the exit code will always be caught by the script task.
6
+
7
+ ## Using variables from other jobs
8
+
9
+ When a variable in a separate job, in a separate template is required you may need to output it manually depending on the task that sets the variable.
10
+
11
+ For example the GitVersion task does not output variables it produces to the pipeline, you must create a separate script task to echo the variable like so:
12
+
13
+ ```yml
14
+ - job: Tagging
15
+ steps:
16
+
17
+ # GitVersion task here.
18
+
19
+ # Output the GitVersion.SemVer variable so it can be used in other jobs.
20
+ - script: echo "##vso[task.setvariable variable=GitVersionSemVer;isOutput=true]$(GitVersion.SemVer)"
21
+ name: setvarStep
22
+ ```
23
+
24
+ Then you can access the variable in a separate job like:
25
+
26
+ ```yml
27
+ - job: Build
28
+ dependsOn: Tagging
29
+ variables:
30
+ # map the output variable from A into this job
31
+ varFromTagJob: $[ dependencies.Tagging.outputs['setvarStep.GitVersionSemVer'] ]
32
+ steps:
33
+ - script: echo $(varFromTagJob) # this step uses the mapped-in variable
34
+ ```
@@ -1,6 +1,8 @@
1
1
  # Common-CI
2
2
  Common-CI project contains a guideline for creation of continuous integration scripts and describes a general approach to continuous integration within 51Degrees. This readme should provide a comprehensive overview of rules and conventions to be expected from existing jobs and which should be followed when new jobs are created.
3
3
 
4
+ **NOTE**: A Release Engineer following this guide should first check the `internal-ci` readme to understand the 51Degrees release process.
5
+
4
6
  # Table of content
5
7
  - [Common-CI](#common-ci)
6
8
  - [Table of content](#table-of-content)
@@ -26,6 +28,10 @@ Common-CI project contains a guideline for creation of continuous integration sc
26
28
  - [Packages release](#packages-release)
27
29
  - [External package managers and public repositories](#external-package-managers-and-public-repositories)
28
30
  - [Automation](#automation)
31
+ - [Fully automated release process](#fully-automated-release-process)
32
+ - [Additional pipelines:](#additional-pipelines)
33
+ - [Updating the Release Configuration](#updating-the-release-configuration)
34
+ - [Fully automated deployment trigger procedure:](#fully-automated-deployment-trigger-procedure)
29
35
  - [Automated Release Scripts](#automated-release-scripts)
30
36
  - [Flow Chart](#flow-chart)
31
37
  - [Naming convention](#naming-convention-1)
@@ -212,6 +218,9 @@ All of the packages for daily continuous deployment are created based on the lat
212
218
  Deployment to internal package managers is performed daily (overnightly) based on changes applied to `develop` branches of the source code repositories.
213
219
 
214
220
  ## Release process
221
+
222
+ Refer to the `internal-ci` readme for instruction on 51Degrees release process.
223
+
215
224
  ### Packages release
216
225
  Packages release process in 51Degrees is handled through Azure DevOps and the deployment to the public repositories is performed manually using packages generated by [Create packages](#create-packages) continuous integration job. As explained in “[Create packages](#create-packages)” section, process of creating the packages is automatically triggered by completion of pull request to the `main` branch of the repository. Created packages are stored as artifacts in Azure DevOps Artifacts and are used in internal release pipelines in order to upload them to the public package managers/repositories.
217
226
 
@@ -224,6 +233,7 @@ API release process steps:
224
233
 
225
234
  ### External package managers and public repositories
226
235
  51Degrees provides APIs for a selection of programming languages and packages are available on the following public package managers:
236
+
227
237
  - [NuGet](https://www.nuget.org/profiles/51Degrees)
228
238
  - [Maven](https://mvnrepository.com/artifact/com.51degrees)
229
239
  - [Packagist](https://packagist.org/packages/51degrees/)
@@ -232,20 +242,28 @@ API release process steps:
232
242
  - Source code on [Github](https://github.com/51Degrees/)
233
243
 
234
244
  ## Automation
235
- Fully automated release process use the following flow:
245
+
246
+ ### Fully automated release process
247
+
248
+ The release process uses the following flow:
236
249
  1. Changes are prepared in `release|hotfix` branches.
237
- 2. `Trigger release` job starts; or all `leaf submodules` are manually or automatically merged to `main|master`.
238
- 3. All `leaf submodules` `release|hotfix` branches are merged to `main`.
250
+ 2. Switch `AutomatedRelease` variable in `CIAutomation` variable group to `On`.
251
+ 3. `Trigger release` job starts; or all `leaf submodules` are manually or automatically merged to `main|master`.
252
+ 1. Since `common-ci` is a submodule of all APIs, this is normally done by having `common-ci` `release|hotfix` branch merged to `main`.
253
+ 2. To merge `common-ci` `release|hotfix` branch to `main`, creating a pull request to `main` is enough since the pull request will be automatically completed at the end of the pull request `build-and-test` check. This is done by a task that calls a set of APIs in `Release` modules.
254
+ 4. All `leaf submodules` `release|hotfix` branches are merged to `main`.
239
255
  1. NOTE: `leaf submodules` are modules which do not have any dependencies.
240
- 4. Completion of submodule merging triggers tag and packages deployment of the submodules. If module does not generate packages, then it will be the tag creation step.
241
- 5. Tag and package deployment (or creation) completion triggers merging of the `release|hotfix` branches of the modules which depend on these submodules.
242
- 6. Completion of merging `release|hotfix` branches to `main` will also trigger `deployment` of packages both internally and externally in the same way that the submodules were done.
243
- 7. At the end of the `release` process, packages are available to be collected internally; and `deployment` to external reposition are left to be approved by `release engineer`.
256
+ 5. Completion of submodule merging triggers tag and packages deployment of the submodules. If module does not generate packages, then it will be the tag creation step.
257
+ 6. Tag and package deployment (or creation) completion triggers `submodule_trigger` pipelines of the parent APIs, which will then update submodule references, package dependencies versions and create a pull request to `main` if one does not exist.
258
+ 7. The pull request of parent APIs will then again be completed once the `build_and_test` check passes.
259
+ 8. Completion of merging `release|hotfix` branches to `main` will also trigger `deployment` of packages both internally and externally in the same way that the submodules were done.
260
+ 9. At the end of the `release` process, packages are available to be collected internally; and `deployment` to external repositories are left to be approved by `release engineer`.
261
+ 10. Switch `AutomatedRelease` variable in `CIAutomation` variable group to `Off` to prevent any accidental references update or pull request completion after this stage.
244
262
 
245
- The fully automated release process is controlled by a `release-config.json` file, located in the `common-ci` repository. The automated release process can also be enabled or disabled by a global variable `AutomatedRelease` as part of the Azure Devops variable group `CIAutomation`. To support automating the deployment process, powershell scripts and additional pipelines are required. These scripts are located under `common-ci` repository, and are grouped into modules. The additional pipelines are required per API, but shared templated can be reused from `common-ci`.
263
+ The fully automated release process is controlled by a `release-config.json` file, located in the `common-ci` repository. There also exists a `release-config-template.json` which contains all settings and APIs that can be included in a `release-config.json`. The automated release process can also be enabled or disabled by a global variable `AutomatedRelease` as part of the Azure Devops variable group `CIAutomation`. To support automating the deployment process, powershell scripts and additional pipelines are required. These scripts are located under `common-ci` repository, and are grouped into modules. The additional pipelines are required per API, but shared templated can be reused from `common-ci`.
246
264
 
247
- Additional pipelines:
248
- - The `submodule trigger` pipeline is required for each API to pick up the package deployment from each of its submodules. Since a module can have multiple submodules, multiple triggers might happen at the same time. Thus, this pipeline should cancel all previous builds and only one at a single time.
265
+ ### Additional pipelines:
266
+ - The `submodule trigger` pipeline is required for each API to pick up the package deployment from each of its submodules. Since a module can have multiple submodules, multiple triggers might happen at the same time. Thus, this pipeline should cancel all previous builds and only run one at a single time.
249
267
  - This must be triggered only by a submodule deployment that happened on the 'main' branch.
250
268
  - This pipeline, will then perform update of all submodule references and package dependencies, using the versions specified in the `release-config.json`.
251
269
  - The `pull request completion` job is required to be done at the end of each `build and test` pipeline.
@@ -253,14 +271,57 @@ Additional pipelines:
253
271
  - The `AutomatedRelease` variable has been enabled.
254
272
  - All submodule references and package dependencies have been updated.
255
273
  - The pull request has been approved and comments have been left unresolved; or approval is not required.
274
+ - Both of the above pipelines will not proceed if a tag already exists for a release version.
275
+
276
+ ### Updating the Release Configuration
277
+
278
+ The release configuration files must be updated to configure which repositories will be released. Each repository can be configured with the following fields:
279
+
280
+ **Files to update:**
281
+
282
+ - `release-config.json`
283
+ - `cloud-release-config.json`
284
+
285
+ Property|Type|Description
286
+ -|-|-
287
+ version|string|The target version of this repository, e.g. the version to release or the current version if a release version does not exist. Should be a valid Semantic Version e.g. `4.3.1`
288
+ packageName|string|The name of the package that this repository contains code for. E.g. FiftyOne.Pipeline
289
+ versionVariableName|string|The variable name used in pipelines to update dependencies.
290
+ isLeaf|boolean|Is this a leaf of the dependency tree, i.e. does this repository have no dependencies?
291
+ dependencies|string[]|A list of dependencies, these are the names of the repositories that this one is dependent on or contains dependencies of the contained projects.
292
+
293
+ While the cloud release **is not** triggered by the automated API release, the `cloud-release-config.json` file will also need to be updated in preparation for the cloud release the following week. Only the version numbers must be updated in this file.
294
+
295
+ A `release-config-template.json` file is provided which contains configurations for all the repos with a release pipeline, this should be used as a reference to modify the release config files. Only edit this file if adding a new repo configuration and updating dependencies.
296
+
297
+ **Rules**
298
+
299
+ There are some **rules** that a release engineer will need to pay attention to when updating the file:
300
+ 1. `packageName`: This name is used to search for matching package reference in a package file of a target language. This is used as part of a regular expression search so regex syntax can also be used. Most of the time, the value will just be a prefix of the package name since an API usually uses unique prefix such as `FiftyOne.DeviceDetection`. However, there are APIs which use more than one prefixes such as `license-dotnet`, where `FiftyOne.License` and `FiftyOne.Resource` are used. In this specific case, the value of a `packageName` can be `FiftyOne.(License|Resource)`. Currently `DotNet` is only one which tests and supports regex `packageName`. Others language APIs have unique package `prefix` so regex is not required.
301
+ 2. `dependencies`: When specify dependencies, make sure the definition of the dependencies are also specified, so that the release process can detect what tag to update to for submodule reference or what version to be updated for package dependencies. Failing to include the dependency definition will result in submodule references and package dependencies not being updated.
302
+ 1. A `dependency` can be either a submodule or a package dependency.
303
+
304
+ **Validation**
305
+
306
+ Once the files have been updated, they can be validated by running the following PowerShell commands:
307
+
308
+ - `Get-Content release-config.json | Out-String | ConvertFrom-Json` - Test JSON is valid
309
+ - `Test-Json -Json "$(Get-Content .\release-config.json)" -SchemaFile .\release-config-schema.json` - Test the file matches the release-config schema.
310
+
311
+ Steps to make changes and update the release config in common-ci repo:
312
+ 1. create new hotfix / release branch in common-ci and push to the remote -
313
+ 1. When determining the branch name for the common-ci hotfix or release branch, typically the version should be the same MAJOR and MINOR version of the API releases however the PATCH version does not need to match and should simply be incremented from the previous version in common-ci. See [validating branch names](#validate-the-release--hotfix-branch-names).
314
+ 2. create new feature branch for release config in common-ci and push to the remote
315
+ 3. update release config with repos, deps and versions for both
316
+ 4. commit modified release config to feature branch and create a pr from the feature branch into the release / hotfix branch.
256
317
 
257
- Fully automated deployment trigger procedure:
318
+ ### Fully automated deployment trigger procedure:
258
319
  1. At the start, `release engineer` will need to update the `release-config.json` to specify all release packages and their target release version. Any additional details should also be specified.
259
320
  1. NOTE: There is a `release-config-template.json` available for references.
260
321
  2. Once the `release-config.json` is ready in one of the `release|hotfix` branch of `common-ci`, either the following should trigger the release process:
261
322
  1. Complete the pull request that contains the updated `release-config.json` changes to the `main` branch. This will only work based on the assumption that the `common-ci` is specified as submodule of all release APIs.
262
323
  1. This pull request can be completed manually or automatically by the `build-and-test.yml` auto completion pull request task. The automatic completion is only enabled if the global variable `AutomatedRelease` specified in the variables group `CIAutomation` is set to `On`.
263
- 2. Trigger the `trigger-release` pipeline of the `common-ci`.
324
+ 2. Trigger the `trigger-release` pipeline of the `common-ci` against the hotfix or release branch.
264
325
 
265
326
  ### Automated Release Scripts
266
327
  As briefly mentioned, the automated release process requires powershell scripts to support tasks that have been done manually. These scripts are located in the directory `scripts/modules` of the `common-ci` repository.
@@ -31,7 +31,12 @@ stages:
31
31
 
32
32
  # Make sure all modules are loaded
33
33
  cd scripts\modules
34
- Get-ChildItem -Directory | Foreach { Import-Module $_.Name -Force }
34
+ Get-ChildItem -Directory | ForEach-Object {
35
+ if($(Get-ChildItem $_.FullName | Where-Object {($_ -like '*.psm1') -or ($_ -like '*.psd1')}).length -gt 0) {
36
+ Write-Output $_.Name
37
+ Import-Module $_.Name -Force
38
+ }
39
+ }
35
40
 
36
41
  # Run all tests
37
42
  # Enable test environment so that production environment is not impacted
@@ -0,0 +1,51 @@
1
+ {
2
+ "repositories": {
3
+ "common-ci": {
4
+ "version": "4.3.16",
5
+ "isLeaf": true
6
+ },
7
+ "pipeline-dotnet": {
8
+ "version": "4.3.7",
9
+ "packageName": "FiftyOne.Pipeline",
10
+ "isLeaf": true
11
+ },
12
+ "entitlement-dotnet": {
13
+ "version": "4.1.12",
14
+ "isLeaf": true
15
+ },
16
+ "location-dotnet": {
17
+ "version": "4.3.6",
18
+ "packageName": "FiftyOne.Geolocation",
19
+ "isLeaf": true
20
+ },
21
+ "device-detection-dotnet": {
22
+ "version": "4.3.7",
23
+ "packageName": "FiftyOne.DeviceDetection",
24
+ "isLeaf": true
25
+ },
26
+ "internal-engines-dotnet": {
27
+ "version": "4.3.3",
28
+ "packageName": "FiftyOne.GeoLocation.OnPremise",
29
+ "isLeaf": true
30
+ },
31
+ "cloud-config": {
32
+ "version": "4.3.0",
33
+ "isLeaf": true
34
+ },
35
+ "cloud-dotnet": {
36
+ "version":"4.3.2",
37
+ "packageName": "FiftyOne.Pipeline.CloudService",
38
+ "isLeaf": false,
39
+ "dependencies": [
40
+ "common-ci",
41
+ "pipeline-dotnet",
42
+ "entitlement-dotnet",
43
+ "internal-engines-dotnet",
44
+ "device-detection-dotnet",
45
+ "location-dotnet",
46
+ "cloud-config"
47
+ ]
48
+ }
49
+ },
50
+ "approvalRequired": false
51
+ }
@@ -25,9 +25,5 @@ steps:
25
25
  command: push
26
26
  packagesToPush: '$(PIPELINE.WORKSPACE)/build-pipeline/drop/**/*.nupkg;!$(PIPELINE.WORKSPACE)/build-pipeline/drop/**/*.symbols.nupkg'
27
27
  nuGetFeedType: external
28
- ${{ if eq(variables['System.TeamProjectId'], 'Pipeline') }}:
29
- publishFeedCredentials: 'NuGet.org - Release'
30
- ${{ if ne(variables['System.TeamProjectId'], 'Pipeline') }}:
31
- # If not 'Pipeline' project, publish to internal instead.
32
- publishVstsFeed: '${{ parameters.feed }}'
28
+ publishFeedCredentials: 'NuGet.org - Release'
33
29
  condition: and(succeeded(), eq('${{ parameters.nugetFeedType }}', 'external'))
@@ -0,0 +1,64 @@
1
+ parameters:
2
+ - name: stageDependencies
3
+ type: object
4
+ default: []
5
+ - name: goVersion
6
+ type: string
7
+ default: '1.17.1'
8
+
9
+ stages:
10
+ # This stage check if current branch runs on a pull request merge branch,
11
+ # then try to complete the pull request if it is true.
12
+ # WARNINGS: This stage should be run at the end of a pipeline, because upon
13
+ # completing a pull request the pipeline will be canceled and no stage
14
+ # or tasks will be run after this.
15
+ - stage: Go_List
16
+ displayName: "Make module available"
17
+ dependsOn: ${{ parameters.stageDependencies }}
18
+
19
+ variables:
20
+ - group: CIAutomation # Required to access CI variables
21
+
22
+ pool:
23
+ vmImage: 'ubuntu-18.04'
24
+
25
+ jobs:
26
+ - job: Go_List
27
+
28
+ steps:
29
+ - checkout: self
30
+ submodules: recursive
31
+ persistCredentials: true
32
+
33
+ # Install go
34
+ - task: GoTool@0
35
+ displayName: 'Use go ${{ parameters.goVersion }}'
36
+ inputs:
37
+ version: '${{ parameters.goVersion }}'
38
+
39
+ # Run go list to make the module available
40
+ - bash: |
41
+ # Fetch all tags
42
+ git fetch --all --tags
43
+ if [ $? != 0 ]; then
44
+ echo "Failed to fetch all tags."
45
+ exit 1
46
+ fi
47
+
48
+ # Check out current branch
49
+ git checkout $(Build.SourceBranchName)
50
+ if [ $? != 0 ]; then
51
+ echo "Failed to checkout branch '$(Build.SourceBranchName)'."
52
+ exit 1
53
+ fi
54
+
55
+ # Get tag version
56
+ export tagName="`git tag --points-at $(Build.SourceBranchName)`"
57
+
58
+ # Get module name
59
+ export modName=`cat go.mod | awk '/module/{print $2}'`
60
+
61
+ # Complete the corresponding pull request
62
+ GOPROXY=proxy.golang.org go list -m $modName@v$tagName
63
+ displayName: 'Make module available'
64
+ condition: and(succeeded(), eq(variables['AutomatedRelease'], 'On'))
@@ -5,4 +5,18 @@ This API complies with the `common-ci` approach.
5
5
  We use Maven to package our Java APIs. The process of signing the result packages for Maven is different from Dotnet signing process.
6
6
  1. The signing process for Java uses `PGP ASCII Armored File` with file extension `.asc` instead of `.pfx` as in Dotnet.
7
7
  2. The process requires the `.asc` file to be imported using `gpg`.
8
- 3. Then the result package will be signed as part of Maven `install` process using `maven-gpg-plugin`.
8
+ 3. Then the result package will be signed as part of Maven `install` process using `maven-gpg-plugin`.
9
+
10
+ ## Deploy External
11
+ The deployment to external of Java Maven packages must be done in the following order:
12
+
13
+ 1. `pipeline-java`
14
+ 2. `device-detection-java`
15
+ 3. `location-java`
16
+
17
+ Steps for each java repo:
18
+ 1. Deploy packages to Nexus staging area - automatic.
19
+ 2. Deploy from Nexus staging to Maven Central - requires approval.
20
+ 3. Deploy to GitHub - requires approval.
21
+
22
+ All Java APIs share a staging area, so occasionally repositories are left in the staging area as a results of a possible cancellation or an unwanted pipeline termination, etc. This sometimes causes the deployment to staging to fail. In this case, it is the best to login to the Nexus staging area and manually drop all unwanted repositories and rerun the deployment process.
@@ -0,0 +1,15 @@
1
+ # PHP Specific CI/CD Approach
2
+ This API complies with the `common-ci` approach.
3
+
4
+ ## Deploy External
5
+ The deployment to external of PHP involves a stage that builds and tests on actual external package. This is not required for internal pipelines such as `build-and-test.yml` as it is acceptable to just use submodule references. However, before deploy to external, the solution is required to work with other external packages. Thus, the deployment to external will fail as some dependencies packages are left waiting for a release engineer to approve. In this case, the failed deployment will need to be rerun after their dependency packages have been deployed to external.
6
+
7
+ Typically the deploy external pipelines should be completed in the following order:
8
+
9
+ 1. `pipeline-php-core`
10
+ 2. `pipeline-php-engines`
11
+ 3. `pipeline-php-cloudrequestengine`
12
+ 4. `device-detection-php`
13
+ 5. `location-php`
14
+
15
+ `device-detection-onpremise-php` is not deployed as a package to Packagist but should be completed after `device-detection-php`
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "title": "Release Config",
5
+ "description": "Contains the release configuration for 51Degrees DevOps pipelines",
6
+ "properties": {
7
+ "repositories": {
8
+ "type": "object",
9
+ "patternProperties": {
10
+ "^[A-Za-z][A-Za-z0-9\\-]*$": {
11
+ "type": "object",
12
+ "properties": {
13
+ "version": {
14
+ "type": "string",
15
+ "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
16
+ },
17
+ "packageName": {
18
+ "type": "string"
19
+ },
20
+ "versionVariableName": {
21
+ "type": "string"
22
+ },
23
+ "isLeaf": {
24
+ "type": "boolean"
25
+ },
26
+ "dependencies": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "string",
30
+ "pattern": "^[A-Za-z][A-Za-z0-9\\-]*$"
31
+ }
32
+ }
33
+ },
34
+ "required": [
35
+ "version",
36
+ "isLeaf"
37
+ ]
38
+ }
39
+ },
40
+ "required": [
41
+ "common-ci"
42
+ ]
43
+ },
44
+ "approvalRequired": {
45
+ "type": "boolean"
46
+ }
47
+ },
48
+ "required": [
49
+ "repositories",
50
+ "approvalRequired"
51
+ ]
52
+ }
@@ -4,6 +4,10 @@
4
4
  "version": "4.3.2",
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,
@@ -16,7 +20,8 @@
16
20
  "isLeaf": false,
17
21
  "dependencies": [
18
22
  "common-ci",
19
- "common-cxx"
23
+ "common-cxx",
24
+ "device-detection-data"
20
25
  ]
21
26
  },
22
27
  "device-detection-varnish": {
@@ -121,10 +126,29 @@
121
126
  "dependencies": [
122
127
  "common-ci",
123
128
  "device-detection-cxx",
129
+ "caching-dotnet",
124
130
  "common-dotnet",
125
131
  "pipeline-dotnet"
126
132
  ]
127
133
  },
134
+ "license-dotnet": {
135
+ "version": "4.3.0",
136
+ "packageName": "FiftyOne.(License|Resource)",
137
+ "isLeaf": false,
138
+ "dependencies": [
139
+ "common-ci"
140
+ ]
141
+ },
142
+ "entitlement-dotnet": {
143
+ "version": "4.1.9",
144
+ "isLeaf": false,
145
+ "dependencies": [
146
+ "common-ci",
147
+ "common-dotnet",
148
+ "license-dotnet",
149
+ "pipeline-dotnet"
150
+ ]
151
+ },
128
152
  "internal-engines-dotnet": {
129
153
  "version": "4.3.0",
130
154
  "packageName": "FiftyOne.GeoLocation.OnPremise",
@@ -255,6 +279,31 @@
255
279
  "pipeline-php-engines",
256
280
  "pipeline-php-cloudrequestengine"
257
281
  ]
282
+ },
283
+ "pipeline-wordpress": {
284
+ "version": "0.9.0",
285
+ "packageName": "fiftyonedegrees.wordpress",
286
+ "isLeaf": false,
287
+ "dependencies": [
288
+ "common-ci",
289
+ "pipeline-php-cloudrequestengine"
290
+ ]
291
+ },
292
+ "device-detection-go": {
293
+ "version": "4.3.1",
294
+ "isLeaf": false,
295
+ "dependencies": [
296
+ "common-ci",
297
+ "device-detection-cxx"
298
+ ]
299
+ },
300
+ "device-detection-examples-go": {
301
+ "version": "4.3.0",
302
+ "isLeaf": false,
303
+ "dependencies": [
304
+ "common-ci",
305
+ "device-detection-go"
306
+ ]
258
307
  }
259
308
  },
260
309
  "approvalRequired": false