Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
},
"forwardPorts": [
80,
443,
1433
],
"initializeCommand": "docker pull criticalmanufacturing.io/criticalmanufacturing/devcontainer:<%= $CLI_PARAM_MESVersion-Major %><%= $CLI_PARAM_DevContainerTagSuffix %>"
Expand Down
1 change: 1 addition & 0 deletions docs/src/03-explore/commands/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cmf init test --tenant test --baseVersion 12.0.0-beta.2 --ciRepo https://dev.cri
* `--config` and `--infrastructure` (alias `--infra`) are optional. The package version defaults to `1.0.0`; normal initialization does not need `--version`.
* `--nugetVersion` and `--testScenariosNugetVersion` default to the MES version. `--ngxSchematicsVersion` defaults to `release-<digits>` for stable releases (for example, `release-1101` for MES `11.0.1`). For prereleases, `init` resolves the matching npm dist-tag (for example, `beta-1200`) against the configured registry and saves the exact version it references. An explicit override skips the lookup.
* The devcontainer image tag uses the MES major version (for example, `12`). When the running CLI is a prerelease, the tag adds `-next` (for example, `12-next`), including in the startup image pull command. The CLI install feature also uses `next` for a prerelease CLI; a stable CLI uses its major range (for example, `6.x.x`).
* Generated devcontainers forward HTTP (`80`), HTTPS (`443`), and SQL Server (`1433`). HTTPS forwarding lets browser-based Security Portal/OpenID login reach the local stack when Docker runs inside the devcontainer. Existing projects must add `443` to `.devcontainer/devcontainer.json`'s `forwardPorts` and reopen the devcontainer, or forward remote port `443` to local port `443` in the editor's Ports view.
* Each registry resolves independently: command-line option, infrastructure file, then default. `--npmRegistry` defaults to `https://criticalmanufacturing.io/repository/npm/`; `--nugetRegistry` defaults to `https://criticalmanufacturing.io/repository/nuget/index.json`. Existing credential options remain supported.
* A config file remains useful for full environment setup. MES v10/v11 HTML scaffolding uses its domain and environment settings; test scaffolding uses its hostname and ports. Supplied files are copied unchanged into `EnvironmentConfigs`, including for MES v12.
* New configs omit unused database server/replica backup paths, AlwaysOn, ReportServer, Installation, Temporary, and Gateway fields; model API properties remain for legacy compatibility.
Expand Down
6 changes: 3 additions & 3 deletions tests/Specs/Init.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void Init_(string baseVersionStr, string dotnetSDKVersion)
.Should().Contain(@$"""image"": ""criticalmanufacturing.io/criticalmanufacturing/devcontainer:{baseVersion.Major}""", "Devcontainer image is not correct");
devContainerFile
.Should().Contain(@$"""version"": ""5.x.x""", "Devcontainer image is not correct");
JObject.Parse(devContainerFile)["forwardPorts"].Values<int>().Should().Equal(80, 1433);
JObject.Parse(devContainerFile)["forwardPorts"].Values<int>().Should().Equal(80, 443, 1433);
}
else
{
Expand Down Expand Up @@ -625,7 +625,7 @@ public void Init_WithoutJsonFiles_ScaffoldsSupportedVersions(string mesVersion,
File.ReadAllText("NuGet.Config").Should().Contain(project["NuGetRegistry"].Value<string>());
File.ReadAllText(".devcontainer/devcontainer.json").Should().Contain($"devcontainer:{NuGetVersion.Parse(mesVersion).Major}");
JObject.Parse(File.ReadAllText(".devcontainer/devcontainer.json"))["forwardPorts"]
.Values<int>().Should().Equal(80, 1433);
.Values<int>().Should().Equal(80, 443, 1433);
var repositories = JsonConvert.DeserializeObject<RepositoriesConfig>(File.ReadAllText("repositories.json"));
repositories.CIRepository.AbsoluteUri.Should().Be("https://dev.criticalmanufacturing.io/");
repositories.Repositories.Should().ContainSingle().Which.AbsoluteUri.Should().Be("https://dev.criticalmanufacturing.io/");
Expand Down Expand Up @@ -845,7 +845,7 @@ public void Init_App()
Assert.True(File.Exists(Path.Combine(tmp, "assets", "default_app_icon.png")), "App Icon is missing");

JObject.Parse(File.ReadAllText(".devcontainer/devcontainer.json"))["forwardPorts"]
.Values<int>().Should().Equal(80, 1433);
.Values<int>().Should().Equal(80, 443, 1433);

File.ReadAllText(Path.Join(tmp, ".project-config.json"))
.Should().Contain(@"""RepositoryType"": ""App""", "Applied repository type was not App");
Expand Down
Loading