diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index d798e0de48..1e9fe0fdcd 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -349,7 +349,7 @@ stages: #Update the version in templates also $templatePath = - 'build/templates/UmbracoSolution/.template.config/template.json' + 'build/templates/UmbracoProject/.template.config/template.json' $a = Get-Content $templatePath -raw | ConvertFrom-Json diff --git a/build/build.ps1 b/build/build.ps1 index 8581fa93ca..be9a8f0f4f 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -344,13 +344,11 @@ $this.CopyFiles("$templates", "*", "$tmp\Templates") Write-Host "Copy files for dotnet templates" - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "Program.cs", "$tmp\Templates\UmbracoSolution") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "Startup.cs", "$tmp\Templates\UmbracoSolution") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "appsettings.json", "$tmp\Templates\UmbracoSolution") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "appsettings.Development.json", "$tmp\Templates\UmbracoSolution") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\Views", "*", "$tmp\Templates\UmbracoSolution\Views") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "Program.cs", "$tmp\Templates\UmbracoProject") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "Startup.cs", "$tmp\Templates\UmbracoProject") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\Views", "*", "$tmp\Templates\UmbracoProject\Views") - $this.RemoveDirectory("$tmp\Templates\UmbracoSolution\bin") + $this.RemoveDirectory("$tmp\Templates\UmbracoProject\bin") }) $ubuild.DefineMethod("PackageZip", diff --git a/build/templates/UmbracoPackage/.template.config/icon.png b/build/templates/UmbracoPackage/.template.config/icon.png index 9500140b38..6e94105808 100644 Binary files a/build/templates/UmbracoPackage/.template.config/icon.png and b/build/templates/UmbracoPackage/.template.config/icon.png differ diff --git a/build/templates/UmbracoProject/.template.config/dotnetcli.host.json b/build/templates/UmbracoProject/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..2727c1dbcc --- /dev/null +++ b/build/templates/UmbracoProject/.template.config/dotnetcli.host.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "PackageTestSiteName": { + "longName": "PackageTestSiteName", + "shortName": "p" + }, + "UseSqlCe": { + "longName": "SqlCe", + "shortName": "ce" + }, + "SkipRestore": { + "longName": "no-restore", + "shortName": "" + }, + "FriendlyName": { + "longName": "friendly-name", + "shortName": "" + }, + "Email": { + "longName": "email", + "shortName": "" + }, + "Password": { + "longName": "password", + "shortName": "" + }, + "ConnectionString":{ + "longName": "connection-string", + "shortName": "" + } + }, + "usageExamples": [ + "dotnet new umbraco -n MyNewProject", + "dotnet new umbraco -n MyNewProjectWithCE -ce", + "dotnet new umbraco -n MyNewProject --no-restore", + "dotnet new umbraco -n MyNewProject --friendly-name "Friendly User" --email user@email.com --password password1234 --connection-string "Server=ConnectionStringHere"" + ] +} diff --git a/build/templates/UmbracoProject/.template.config/icon.png b/build/templates/UmbracoProject/.template.config/icon.png new file mode 100644 index 0000000000..6e94105808 Binary files /dev/null and b/build/templates/UmbracoProject/.template.config/icon.png differ diff --git a/build/templates/UmbracoProject/.template.config/ide.host.json b/build/templates/UmbracoProject/.template.config/ide.host.json new file mode 100644 index 0000000000..af5ff5e24c --- /dev/null +++ b/build/templates/UmbracoProject/.template.config/ide.host.json @@ -0,0 +1,60 @@ +{ + "$schema": "http://json.schemastore.org/vs-2017.3.host", + "order" : 0, + "icon": "icon.png", + "description": { + "id": "UmbracoProject", + "text": "Umbraco Web Application - An empty Umbraco CMS web application" + }, + "symbolInfo": [ + { + "id": "UseSqlCe", + "name": { + "text": "Use Sql Compact Edition (SqlCE)" + }, + "isVisible": "true" + }, + { + "id": "SkipRestore", + "name": { + "text": "Skips the automatic NuGet restore of the project on create" + }, + "isVisible": "true" + }, + { + "id": "PackageTestSiteName", + "name": { + "text": "Optional: Specify the name of a package that this should be a test site for" + }, + "isVisible": "true" + }, + { + "id": "FriendlyName", + "name": { + "text": "Optional: The friendly name of the user for Umbraco login when using Unattended install" + }, + "isVisible": "true" + }, + { + "id": "Email", + "name": { + "text": "Optional: Email to use for Umbraco login when using Unattended install" + }, + "isVisible": "true" + }, + { + "id": "Password", + "name": { + "text": "Optional: Password to use for Umbraco login when using Unattended install" + }, + "isVisible": "true" + }, + { + "id": "ConnectionString", + "name": { + "text": "Optional: Database connection string when using Unattended install" + }, + "isVisible": "true" + } + ] +} diff --git a/build/templates/UmbracoProject/.template.config/template.json b/build/templates/UmbracoProject/.template.config/template.json new file mode 100644 index 0000000000..203c5abd1a --- /dev/null +++ b/build/templates/UmbracoProject/.template.config/template.json @@ -0,0 +1,140 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Umbraco HQ", + "description": "An empty Umbraco Project ready to get started", + "classifications": [ "Web", "CMS", "Umbraco"], + "groupIdentity": "Umbraco.Templates.UmbracoProject", + "identity": "Umbraco.Templates.UmbracoProject.CSharp", + "name": "Umbraco Project", + "shortName": "umbraco", + "defaultName": "UmbracoProject1", + "preferNameDirectory": true, + "tags": { + "language": "C#", + "type": "project" + }, + "primaryOutputs": [ + { + "path": "UmbracoProject.csproj" + } + ], + "postActions": [ + { + "condition": "(!SkipRestore)", + "description": "Restore NuGet packages required by this project", + "manualInstructions": [{ + "text": "Run 'dotnet restore'" + }], + "actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025", + "continueOnError": true + } + ], + "sourceName": "UmbracoProject", + "symbols": { + "version": { + "type": "parameter", + "datatype": "string", + "defaultValue": "9.0.0-beta001", + "description": "The version of Umbraco to load using NuGet", + "replaces": "UMBRACO_VERSION_FROM_TEMPLATE" + }, + "namespaceReplacer": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "name", + "defaultValue": "UmbracoProject", + "fallbackVariableName": "name" + }, + "replaces":"Umbraco.Web.UI.NetCore" + }, + "PackageTestSiteName": { + "type": "parameter", + "datatype":"text", + "defaultValue": "", + "replaces":"PackageTestSiteName", + "description": "The name of the package this should be a test site for (Default: '')" + }, + "UseSqlCe":{ + "type": "parameter", + "datatype":"bool", + "defaultValue": "false", + "description": "Adds the required dependencies to use SqlCE (Windows only) (Default: false)" + }, + "Framework": { + "type": "parameter", + "description": "The target framework for the project", + "datatype": "choice", + "choices": [ + { + "choice": "net5.0", + "description": "Target net5.0" + }, + { + "choice": "net6.0", + "description": "Target net6.0" + } + ], + "replaces": "net5.0", + "defaultValue": "net5.0" + }, + "SkipRestore": { + "type": "parameter", + "datatype": "bool", + "description": "If specified, skips the automatic restore of the project on create", + "defaultValue": "false" + }, + "HttpPort": { + "type": "generated", + "generator": "port", + "replaces": "HTTP_PORT_FROM_TEMPLATE", + "parameters": { + "high": 65535, + "low": 1024, + "fallback": 5000 + } + }, + "HttpsPort": { + "type": "generated", + "generator": "port", + "replaces": "HTTPS_PORT_FROM_TEMPLATE", + "parameters": { + "high": 65535, + "low": 1024, + "fallback": 5001 + } + }, + "FriendlyName":{ + "type": "parameter", + "datatype":"text", + "description": "The friendly name of the user for Umbraco login when using Unattended install (Without installer wizard UI)", + "replaces": "FRIENDLY_NAME_FROM_TEMPLATE", + "defaultValue": "" + }, + "Email":{ + "type": "parameter", + "datatype":"text", + "description": "Email to use for Umbraco login when using Unattended install (Without installer wizard UI)", + "replaces": "EMAIL_FROM_TEMPLATE", + "defaultValue": "" + }, + "Password":{ + "type": "parameter", + "datatype":"text", + "description": "Password to use for Umbraco login when using Unattended install (Without installer wizard UI)", + "replaces": "PASSWORD_FROM_TEMPLATE", + "defaultValue": "" + }, + "ConnectionString":{ + "type": "parameter", + "datatype":"text", + "description": "Database connection string when using Unattended install (Without installer wizard UI)", + "replaces": "CONNECTION_FROM_TEMPLATE", + "defaultValue": "" + }, + "UsingUnattenedInstall":{ + "type": "computed", + "value": "(FriendlyName != \"\" && Email != \"\" && Password != \"\" && ConnectionString != \"\")" + } + } +} diff --git a/build/templates/UmbracoSolution/Properties/launchSettings.json b/build/templates/UmbracoProject/Properties/launchSettings.json similarity index 68% rename from build/templates/UmbracoSolution/Properties/launchSettings.json rename to build/templates/UmbracoProject/Properties/launchSettings.json index 130f45dedf..3819fb7c86 100644 --- a/build/templates/UmbracoSolution/Properties/launchSettings.json +++ b/build/templates/UmbracoProject/Properties/launchSettings.json @@ -3,8 +3,8 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:5000", - "sslPort": 5001 + "applicationUrl": "http://localhost:HTTP_PORT_FROM_TEMPLATE", + "sslPort": HTTPS_PORT_FROM_TEMPLATE } }, "profiles": { @@ -20,7 +20,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "https://localhost:5001;http://localhost:5000" + "applicationUrl": "https://localhost:HTTPS_PORT_FROM_TEMPLATE;http://localhost:HTTP_PORT_FROM_TEMPLATE" } } } diff --git a/build/templates/UmbracoSolution/UmbracoSolution.csproj b/build/templates/UmbracoProject/UmbracoProject.csproj similarity index 100% rename from build/templates/UmbracoSolution/UmbracoSolution.csproj rename to build/templates/UmbracoProject/UmbracoProject.csproj diff --git a/build/templates/UmbracoSolution/Views/_ViewImports.cshtml b/build/templates/UmbracoProject/Views/_ViewImports.cshtml similarity index 100% rename from build/templates/UmbracoSolution/Views/_ViewImports.cshtml rename to build/templates/UmbracoProject/Views/_ViewImports.cshtml diff --git a/build/templates/UmbracoProject/appsettings.Development.json b/build/templates/UmbracoProject/appsettings.Development.json new file mode 100644 index 0000000000..0823d89494 --- /dev/null +++ b/build/templates/UmbracoProject/appsettings.Development.json @@ -0,0 +1,50 @@ +{ + "Serilog": { + "MinimumLevel": { + "Default": "Information" + }, + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console" + } + ] + } + } + ] + }, + //#if (UsingUnattenedInstall) + "ConnectionStrings": { + "umbracoDbDSN": "CONNECTION_FROM_TEMPLATE" + }, + //#endif + "Umbraco": { + "CMS": { + //#if (UsingUnattenedInstall) + "Unattended": { + "InstallUnattended": true, + "UnattendedUserName": "FRIENDLY_NAME_FROM_TEMPLATE", + "UnattendedUserEmail": "EMAIL_FROM_TEMPLATE", + "UnattendedUserPassword": "PASSWORD_FROM_TEMPLATE" + }, + //#endif + "Global": { + "Smtp": { + "From": "your@email.here", + "Host": "localhost", + "Port": 25 + } + }, + "Hosting": { + "Debug": true + }, + "RuntimeMinification": { + "useInMemoryCache": true, + "cacheBuster": "Timestamp" + } + } + } +} \ No newline at end of file diff --git a/build/templates/UmbracoProject/appsettings.json b/build/templates/UmbracoProject/appsettings.json new file mode 100644 index 0000000000..140c970ebb --- /dev/null +++ b/build/templates/UmbracoProject/appsettings.json @@ -0,0 +1,22 @@ +{ + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information", + "System": "Warning" + } + } + }, + "ConnectionStrings": { + "umbracoDbDSN": "" + }, + "Umbraco": { + "CMS": { + "Hosting": { + "Debug": false + } + } + } +} diff --git a/build/templates/UmbracoSolution/.template.config/dotnetcli.host.json b/build/templates/UmbracoSolution/.template.config/dotnetcli.host.json deleted file mode 100644 index d8ae0f76c7..0000000000 --- a/build/templates/UmbracoSolution/.template.config/dotnetcli.host.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/dotnetcli.host", - "symbolInfo": { - "PackageTestSiteName": { - "longName": "PackageTestSiteName", - "shortName": "p" - }, - "UseSqlCe": { - "longName": "SqlCe", - "shortName": "ce" - } - } -} diff --git a/build/templates/UmbracoSolution/.template.config/icon.png b/build/templates/UmbracoSolution/.template.config/icon.png deleted file mode 100644 index 9500140b38..0000000000 Binary files a/build/templates/UmbracoSolution/.template.config/icon.png and /dev/null differ diff --git a/build/templates/UmbracoSolution/.template.config/ide.host.json b/build/templates/UmbracoSolution/.template.config/ide.host.json deleted file mode 100644 index 7604d3b1f4..0000000000 --- a/build/templates/UmbracoSolution/.template.config/ide.host.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/vs-2017.3.host", - "order" : 0, - "icon": "icon.png", - "description": { - "id": "UmbracoSolution", - "text": "Umbraco Web Application - An empty Umbraco CMS web application" - }, - "symbolInfo": [ - { - "id": "PackageTestSiteName", - "name": { - "text": "Optional: Specific the name of a package that this should be a test site for.", - }, - "isVisible": "true" - }, - { - "id": "UseSqlCe", - "name": { - "text": "Use Sql Compact Edition (SqlCE)" - }, - "isVisible": "true" - } - ] - -} diff --git a/build/templates/UmbracoSolution/.template.config/template.json b/build/templates/UmbracoSolution/.template.config/template.json deleted file mode 100644 index 7e45b01f4d..0000000000 --- a/build/templates/UmbracoSolution/.template.config/template.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/template", - "author": "Umbraco HQ", - "description": "An empty Umbraco Solution ready to get started", - "classifications": [ "Web", "CMS", "Umbraco"], - "groupIdentity": "Umbraco.Templates.UmbracoSolution", - "identity": "Umbraco.Templates.UmbracoSolution.CSharp", - "name": "Umbraco Solution", - "shortName": "umbraco", - "defaultName": "UmbracoSolution1", - "preferNameDirectory": true, - "tags": { - "language": "C#", - "type": "project" - }, - "primaryOutputs": [ - { - "path": "UmbracoSolution.csproj" - } - ], - "sourceName": "UmbracoSolution", - "preferNameDirectory": true, - "symbols": { - "version": { - "type": "parameter", - "datatype": "string", - "defaultValue": "9.0.0-beta001", - "description": "The version of Umbraco to load using NuGet", - "replaces": "UMBRACO_VERSION_FROM_TEMPLATE" - }, - "namespaceReplacer": { - "type": "generated", - "generator": "coalesce", - "parameters": { - "sourceVariableName": "name", - "defaultValue": "UmbracoSolution", - "fallbackVariableName": "name" - }, - "replaces":"Umbraco.Web.UI.NetCore" - }, - "PackageTestSiteName": { - "type": "parameter", - "datatype":"text", - "defaultValue": "", - "replaces":"PackageTestSiteName", - "description": "The name of the package this should be a test site for (Default: '')" - }, - "UseSqlCe":{ - "type": "parameter", - "datatype":"bool", - "defaultValue": "false", - "description": "Adds the required dependencies to use SqlCE (Windows only) (Default: false)" - }, - "Framework": { - "type": "parameter", - "description": "The target framework for the project.", - "datatype": "choice", - "choices": [ - { - "choice": "net5.0", - "description": "Target net5.0" - }, - { - "choice": "net6.0", - "description": "Target net6.0" - } - ], - "replaces": "net5.0", - "defaultValue": "net5.0" - } - } -}