From d80e4351a1839a5a21c8c3d94ba1d7db0874f660 Mon Sep 17 00:00:00 2001 From: Alexander Morogov Date: Thu, 24 Aug 2023 12:17:28 +0200 Subject: [PATCH 1/2] VCI-151: Update docs; fix default saas portal url --- CHANGELOG.md | 23 +++++++++++++++++++++ docs/CLI-tools/package-management.md | 4 ++++ src/VirtoCommerce.Build/Cloud/Build.SaaS.cs | 4 ++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd36769..7e9dc1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.16.0] - 2023-08-24 +### Added +- Organization parameter for SetEnvParameter target +### Fixed +- Ignoring of PackageManifestPath +- Trigger of Rollback target +- Directory names for modules downloaded from Azure blobs +- failure of backup target when directory is empty + +## [3.15.0] - 2023-08-08 +### Added +- Support of bundles in the Update target +- Log message for modules from github private repos +### Fixed +- Ignoring of failures in modules installation +- Failure if modules directory doesn't exists for AzureBlob source +### Changed +- Update targe updates to the latest stable bundle by default + +## [3.14.0] - 2023-04-17 +### Changed +- Updated dependecies + ## [3.13.0] - 2023-04-03 ### Added - PlatformAssetUrl to the package manifest diff --git a/docs/CLI-tools/package-management.md b/docs/CLI-tools/package-management.md index b8ce819..acc1211 100644 --- a/docs/CLI-tools/package-management.md +++ b/docs/CLI-tools/package-management.md @@ -145,6 +145,8 @@ vc-build install -stable -bundlesUrl https://somedomain.com/bundles.json # will ```console vc-build update (with no args) +vc-build update -edge +vc-build update -v 5 vc-build update -platform -version vc-build update -module -version ``` @@ -153,6 +155,8 @@ If `` is not specified, the component will be updated to the latest ver If no args are specified, the platform and all modules in the specified location will be updated. This command also updates the installed dependency versions in the `vc-package.json` file. +Since the version 3.15.0 this target updates to stable bundles by default. If you want to update to the latest available versions you can add -Edge parameter. +You can specify the bundle to update your environment to specific versions using -v parameter. ### Examples: ```console diff --git a/src/VirtoCommerce.Build/Cloud/Build.SaaS.cs b/src/VirtoCommerce.Build/Cloud/Build.SaaS.cs index 1a56255..228482e 100644 --- a/src/VirtoCommerce.Build/Cloud/Build.SaaS.cs +++ b/src/VirtoCommerce.Build/Cloud/Build.SaaS.cs @@ -49,7 +49,7 @@ internal partial class Build [Parameter("Number of attempts before fail")] public int AttemptsNumber { get; set; } = 100; - [Parameter("SaaS Portal")] public string CloudUrl { get; set; } = "https://cloud.govirto.com"; + [Parameter("SaaS Portal")] public string CloudUrl { get; set; } = "https://portal.virtocommerce.cloud"; [Parameter("SaaS Token")] public string CloudToken { get; set; } [Parameter("App Project Name")] public string AppProject { get; set; } [Parameter("Cloud Environment Name")] public string EnvironmentName { get; set; } @@ -128,7 +128,7 @@ internal partial class Build { var cloudClient = new VirtoCloudClient(CloudUrl, CloudToken); var env = await cloudClient.GetEnvironment(EnvironmentName, SaaSOrganizationName); - + var envHelmParameters = env.Helm.Parameters; foreach (var parameter in HelmParameters) { From f1b640a1746f99a771199a3f52f49944f76d9bf3 Mon Sep 17 00:00:00 2001 From: Alexander Morogov Date: Fri, 22 Sep 2023 16:48:49 +0200 Subject: [PATCH 2/2] VCI-669: Make the install target stable by default --- docs/CLI-tools/package-management.md | 2 +- docs/targets.md | 4 +- .../PlatformTools/Build.PackageManager.cs | 9 +-- .../PlatformTools/PackageManager.cs | 72 +++++++++---------- 4 files changed, 43 insertions(+), 44 deletions(-) diff --git a/docs/CLI-tools/package-management.md b/docs/CLI-tools/package-management.md index acc1211..7793d56 100644 --- a/docs/CLI-tools/package-management.md +++ b/docs/CLI-tools/package-management.md @@ -93,7 +93,7 @@ The `vc-package.json` file is used to maintain the list of installed modules wit - `vc-build install (with no args)` This target downloads and installs the platform and modules into the relevant folder with versions described in `vc-package.json`. -If `vc-package.json` is not found in the local folder, the command will by default download and install the latest platform and module versions marked as `commerce`. +If `vc-package.json` is not found in the local folder, the command will by default download and install the latest stable bundle. If -Edge parameter has been used then this target will download the latest available platform and modules marked as `commerce`. By default, the `install` target will install all modules listed as dependencies in `vc-package.json`. diff --git a/docs/targets.md b/docs/targets.md index 793916b..676b4dd 100644 --- a/docs/targets.md +++ b/docs/targets.md @@ -21,7 +21,9 @@ By default, install target will install all modules listed as dependencies in vc Path to vc-package.json, discovery and probing paths can be overridden with PackageManifestPath, DiscoveryPath, ProbingPath parameters. Also we can skip dependency solving with SkipDependencySolving parameter. Since version 2.0.0-beta0005 the -module parameter is case insensitive -When you are using one of the source which requires the authorization you can pass tokens using these parameters: GithubToken, AzureToken, GitLabToken. +When you are using one of the source which requires the authorization you can pass tokens using these parameters: GithubToken, AzureToken, GitLabToken. + +Since version 3.17.0 this target installs stable versions of modules by default. If you need the latest available versions you should use -Edge parameter Examples: ```console vc-build install (with no args) diff --git a/src/VirtoCommerce.Build/PlatformTools/Build.PackageManager.cs b/src/VirtoCommerce.Build/PlatformTools/Build.PackageManager.cs index c6472c5..e670741 100644 --- a/src/VirtoCommerce.Build/PlatformTools/Build.PackageManager.cs +++ b/src/VirtoCommerce.Build/PlatformTools/Build.PackageManager.cs @@ -47,9 +47,6 @@ internal partial class Build [Parameter("Gitlab Server (default: https://gitlab.com/api/v4)")] public static string GitLabServer { get; set; } = "https://gitlab.com/api/v4"; - [Parameter("Get bundle")] - public static bool Stable { get; set; } - [Parameter("Bundle name (default: latest)", Name = "v")] public static string BundleName { get; set; } = "latest"; @@ -74,7 +71,7 @@ internal partial class Build .DependsOn(Backup) .Executes(async () => { - var packageManifest = await OpenOrCreateManifest(PackageManifestPath, Stable); + var packageManifest = await OpenOrCreateManifest(PackageManifestPath, Edge); var githubModuleSources = PackageManager.GetGithubModuleManifests(packageManifest); var modules = PackageManager.GetGithubModules(packageManifest); @@ -593,11 +590,11 @@ private async Task UpdateEdgeModulesAsync(ManifestBase manifest) return manifest; } - private async Task OpenOrCreateManifest(string packageManifestPath, bool isStableBundle) + private async Task OpenOrCreateManifest(string packageManifestPath, bool isEdge) { ManifestBase packageManifest; var platformWebDllPath = Path.Combine(Directory.GetParent(packageManifestPath).FullName, "VirtoCommerce.Platform.Web.dll"); - if (isStableBundle) + if (!isEdge) { SkipDependencySolving = true; if (File.Exists(packageManifestPath)) diff --git a/src/VirtoCommerce.Build/PlatformTools/PackageManager.cs b/src/VirtoCommerce.Build/PlatformTools/PackageManager.cs index 7207ff2..89cdcb6 100644 --- a/src/VirtoCommerce.Build/PlatformTools/PackageManager.cs +++ b/src/VirtoCommerce.Build/PlatformTools/PackageManager.cs @@ -4,14 +4,14 @@ using Nuke.Common.IO; using VirtoCommerce.Build.PlatformTools; -namespace PlatformTools +namespace PlatformTools { - public static class PackageManager - { - private static readonly string _defaultModuleManifest = "https://raw.githubusercontent.com/VirtoCommerce/vc-modules/master/modules_v3.json"; - - public static ManifestBase CreatePackageManifest(string platformVersion, string platformAssetUrl) - { + public static class PackageManager + { + private static readonly string _defaultModuleManifest = "https://raw.githubusercontent.com/VirtoCommerce/vc-modules/master/modules_v3.json"; + + public static ManifestBase CreatePackageManifest(string platformVersion, string platformAssetUrl) + { var manifest = new MixedPackageManifest { ManifestVersion = "2.0", @@ -28,30 +28,30 @@ public static ManifestBase CreatePackageManifest(string platformVersion, string Modules = new List() } } - }; - return manifest; - } - + }; + return manifest; + } + public static ManifestBase CreatePackageManifest(string platformVersion) { return CreatePackageManifest(platformVersion, ""); } - public static MixedPackageManifest UpdatePlatform(MixedPackageManifest manifest, string newVersion) - { - manifest.PlatformVersion = newVersion; - return manifest; - } - - public static void ToFile(ManifestBase manifest, string path = "./vc-package.json") + public static MixedPackageManifest UpdatePlatform(MixedPackageManifest manifest, string newVersion) + { + manifest.PlatformVersion = newVersion; + return manifest; + } + + public static void ToFile(ManifestBase manifest, string path = "./vc-package.json") { - SerializationTasks.JsonSerializeToFile(manifest, path); + SerializationTasks.JsonSerializeToFile(manifest, path); } - - public static ManifestBase FromFile(string path = "./vc-package.json") - { - var baseManifest = SerializationTasks.JsonDeserializeFromFile(path); - ManifestBase result; + + public static ManifestBase FromFile(string path = "./vc-package.json") + { + var baseManifest = SerializationTasks.JsonDeserializeFromFile(path); + ManifestBase result; if (string.IsNullOrEmpty(baseManifest.ManifestVersion) || new Version(baseManifest.ManifestVersion) < new Version("2.0")) { result = SerializationTasks.JsonDeserializeFromFile(path); @@ -61,9 +61,9 @@ public static ManifestBase FromFile(string path = "./vc-package.json") result = SerializationTasks.JsonDeserializeFromFile(path); } - return result; - } - + return result; + } + public static List GetModuleSources(ManifestBase manifest) { @@ -86,14 +86,14 @@ public static List GetModuleSources(ManifestBase manifest) break; } return result; - } - + } + public static GithubReleases GetGithubModulesSource(ManifestBase manifest) { var sources = GetModuleSources(manifest); return (GithubReleases)sources.FirstOrDefault(s => s.Name == nameof(GithubReleases)); - } - + } + public static List GetGithubModuleManifests(ManifestBase manifest) { List result; @@ -111,8 +111,8 @@ public static List GetGithubModuleManifests(ManifestBase manifest) break; } return result; - } - + } + public static List GetGithubModules(ManifestBase manifest) { List result; @@ -130,6 +130,6 @@ public static List GetGithubModules(ManifestBase manifest) break; } return result; - } - } -} + } + } +}