2021-05-18 19:07:17 +02:00
|
|
|
name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
|
v10 SQLite support + distributed locking abstractions (#11922)
* Created Persistence.SQLite project skeleton.
* SQLite database initialization
* Various changes and hacks to make things work.
* WIP integration tests
* Fix thread safety tests
* Fix tests that relied on tie breaker sorting.
Spent a fair amount of time looking for a less lazy fix but gave up.
* Convert right join to left join ContentTypeRepository.PerformGetByQuery
SQLite doesn't support right join
* Fix test Can_Generate_Delete_SubQuery_Statement
Worth noting that NPoco.DatabaseTypes.SQLiteDatabaseType doesn't override
EscapeSqlIdentifier so NPoco will escape with [].
SQLite docs say > "A keyword enclosed in square brackets is an identifier.
This is not standard SQL.
This quoting mechanism is used by MS Access and SQL Server and is
included in SQLite for compatibility."
Also could have updated SqliteSyntaxProvider to match npoco but
decided against it.
* Fixes for paginated custom order by
* Fix tests broken by lack of unique indexes.
* Fix SqlServerTableByTableTest tests.
These tests didn't actually do anything as the tables already exist so schema creator just returned.
Did however point out that the default implementation for DoesTableExist just returns false so added a default naive implementation.
* Fix ValidateLoginSession - SelectTop must come later
* dry up database cleanup
* Fix up db migration tests.
We can't drop pk in sqlite without recreating table.
Test looks to be testing that add column works as intended which we can test.
* Prevent schema creation errors.
* SQLite ignore lock tests, WAL back on.
* Fix package schema tests
* Fix NPocoFetchTests - case sensitivity not under test
* Fix AdvancedMigrationTests (where possible)
Migrations probably need a good look later.
Maybe nuke old migrations and only support moving to v10 from v9.
If we do that can do some cleanup.
* Cleanup test database configuration
* Run integration tests against SQLite on build agent.
* Drop MS.Data.SQLite
System.Data.SQLite was quicker to roll out due to more CLR type mapping
* YAML
* Skip Umbraco.Tests.Integration.SqlCe
* Drop SqlServerTableByTable tests.
Until this week they did nothing anyway as they with NewSchemaPerTest
so the tests all passed as CreateTable was no op (already exists).
Also all of the tables are created in an empty database by SchemaValidationTest.cs
DatabaseSchemaCreation_Produces_DatabaseSchemaResult_With_Zero_Errors
* Might aswell run against macOS also.
* Copy azure pipelines task header layout
* Delete SQLCe projects
* Remove SQL CE specific code.
* Remove SQL CE NuSpec, template params, build script setup
* Delete umbraco-netcore-only.sln
* Add SkipTests solution configuration and use for codeql
* Remove reference to deleted nuspec file.
* Refactor ConnectionStrings WRT DataDirectory placeholder & ProviderName.
At this point you can try out SQLite support by setting the following
in appsettings.json and then completing the install process.
"ConnectionStrings": {
"umbracoDbDSN": "Data Source=|DataDirectory|/umbraco.sqlite",
"umbracoDbDSN_ProviderName": "System.Data.SQLite"
},
Not currently possible via installer UI without provider name pre-set in
configuration.
* Switch to Microsoft.Data.Sqlite
Some gross hacks but will be good to find out if this works
with apple silicon.
* Enable selection of SQLite via installer UI (also quick install)
* Remove SqlServerDbProviderFactoryCreator to cleanup a TODO
* Move SQL Server support to its own class library
* Add persistence dependencies to Umbraco.CMS metapackage
* Bugfix packages delete query
Created invalid query for SQLite.
* Try out cypress tests Linux + SQLite
* Prevent cypress test artifact upload failure on attempt 2+
* LocalDb bugfixes
* Drop redundant enum
* Move SqlClient constant
* Misc whitespace
* Remove IsSqlCe extension (TODO: drop non 9->10 migrations later).
* Umbraco.Persistence.* -> Umbraco.Cms.Persistence.*
* Display quick install defaults and per provider default database name.
* Misc remove old comment
* little re-arrange
* Remove almost all usages of IsSqlite extension.
* visual adjustments
* Custom Database Configuration is last step and should then say Install.
* use text instead of disabled inputs
* move legend, rename to Install
* Update SqlMainDomLock to work without distributed locks.
* Added IDistributedLockingMechanism interface and in memory impl.
* Drop locking from ISqlSyntaxProvider & wire up scope to abstraction.
* Added SqlServerDistributedLockingMechanism
* Move distributed locking interfaces and exceptions to Core + xmldocs.
* Fix tests, Misc cleanup, Add SQL distributed locking integration tests
* Provide mechanism to specify DistributedLockingMechanism in config
(even if added by composer)
* Nomplementation -> NoImplementation
* Fix misleading comment
* Integration tests use SqlServerDistributedLockingMechanism when possible
* Handle up-gradable locks SqlServerDistributedLockingMechanism.
TODO: InMemoryDistributedLockingMechanism.
Note: Nuked SqlServerDistributedLockingMechanismTests, will still sleep
at night.
Is covered by Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.LockTests
* Make tests pass for InMemoryDistributedLockingMechanism, pretty hacky.
* Tweak constraints on WithCollectionBuilder so i can drop bad constructor
* Added SqliteDistributedLockingMechanism
* Dropped InMemoryDistributedMechanism + magic
InMemoryDistributedMechanism was pretty rubbish and now we have
a decent implementation for SQLite as we no longer block readers
see 8d1f42b.
Also drop the CollectionBuilder setup, instead do the same as we do
for syntax providers etc, it's more automagical so we never require an
explicit selection although we are allowing for it.
However keeping the optional IUmbracoBuilder constructor param for
CollectionBuilders as it's extremely useful.
* Fix quick install "" database name.
* Hide Database Configuration section when a connection string is pre-set.
Doesn't seem worth it to extract db name from connection string.
* Ensure wal test 2+
* Fix logging inconsistencies.
* Ensure in transaction when obtaining locks + no-op the SQLite read lock.
There's no point in running the query just to make a single test pass.
* Fix installer database display names
* Allow SQLite shared cache without losing deferred transactions
* Opt into shared cache for new SQLite databases + fix filename
* Fix misc inconsistency in .gitignore
* Prefer our interceptor interface
* Restore DEBUG_DATABASES code OnConnectionOpened in case it's used.
* Back to private cache.
* Added retry strategy for SQLite + refactor out SQL server specific stuff
* Fix SQL server tests.
* Misc - Orphaned comment, incorrect casing.
* InMemory SQLite test database & turn shared cache back on everywhere.
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2022-03-11 16:14:20 +00:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
parameters:
|
|
|
|
|
- name: sqlServerIntegrationTests
|
|
|
|
|
displayName: Run SQL Server Integration Tests
|
|
|
|
|
type: boolean
|
|
|
|
|
default: false
|
|
|
|
|
- name: myGetDeploy
|
|
|
|
|
displayName: Deploy to MyGet
|
|
|
|
|
type: boolean
|
|
|
|
|
default: false
|
|
|
|
|
- name: nuGetDeploy
|
|
|
|
|
displayName: Deploy to NuGet
|
|
|
|
|
type: boolean
|
|
|
|
|
default: false
|
|
|
|
|
- name: buildApiDocs
|
|
|
|
|
displayName: Build API docs
|
|
|
|
|
type: boolean
|
|
|
|
|
default: false
|
|
|
|
|
- name: uploadApiDocs
|
|
|
|
|
displayName: Upload API docs
|
|
|
|
|
type: boolean
|
|
|
|
|
default: false
|
v10 SQLite support + distributed locking abstractions (#11922)
* Created Persistence.SQLite project skeleton.
* SQLite database initialization
* Various changes and hacks to make things work.
* WIP integration tests
* Fix thread safety tests
* Fix tests that relied on tie breaker sorting.
Spent a fair amount of time looking for a less lazy fix but gave up.
* Convert right join to left join ContentTypeRepository.PerformGetByQuery
SQLite doesn't support right join
* Fix test Can_Generate_Delete_SubQuery_Statement
Worth noting that NPoco.DatabaseTypes.SQLiteDatabaseType doesn't override
EscapeSqlIdentifier so NPoco will escape with [].
SQLite docs say > "A keyword enclosed in square brackets is an identifier.
This is not standard SQL.
This quoting mechanism is used by MS Access and SQL Server and is
included in SQLite for compatibility."
Also could have updated SqliteSyntaxProvider to match npoco but
decided against it.
* Fixes for paginated custom order by
* Fix tests broken by lack of unique indexes.
* Fix SqlServerTableByTableTest tests.
These tests didn't actually do anything as the tables already exist so schema creator just returned.
Did however point out that the default implementation for DoesTableExist just returns false so added a default naive implementation.
* Fix ValidateLoginSession - SelectTop must come later
* dry up database cleanup
* Fix up db migration tests.
We can't drop pk in sqlite without recreating table.
Test looks to be testing that add column works as intended which we can test.
* Prevent schema creation errors.
* SQLite ignore lock tests, WAL back on.
* Fix package schema tests
* Fix NPocoFetchTests - case sensitivity not under test
* Fix AdvancedMigrationTests (where possible)
Migrations probably need a good look later.
Maybe nuke old migrations and only support moving to v10 from v9.
If we do that can do some cleanup.
* Cleanup test database configuration
* Run integration tests against SQLite on build agent.
* Drop MS.Data.SQLite
System.Data.SQLite was quicker to roll out due to more CLR type mapping
* YAML
* Skip Umbraco.Tests.Integration.SqlCe
* Drop SqlServerTableByTable tests.
Until this week they did nothing anyway as they with NewSchemaPerTest
so the tests all passed as CreateTable was no op (already exists).
Also all of the tables are created in an empty database by SchemaValidationTest.cs
DatabaseSchemaCreation_Produces_DatabaseSchemaResult_With_Zero_Errors
* Might aswell run against macOS also.
* Copy azure pipelines task header layout
* Delete SQLCe projects
* Remove SQL CE specific code.
* Remove SQL CE NuSpec, template params, build script setup
* Delete umbraco-netcore-only.sln
* Add SkipTests solution configuration and use for codeql
* Remove reference to deleted nuspec file.
* Refactor ConnectionStrings WRT DataDirectory placeholder & ProviderName.
At this point you can try out SQLite support by setting the following
in appsettings.json and then completing the install process.
"ConnectionStrings": {
"umbracoDbDSN": "Data Source=|DataDirectory|/umbraco.sqlite",
"umbracoDbDSN_ProviderName": "System.Data.SQLite"
},
Not currently possible via installer UI without provider name pre-set in
configuration.
* Switch to Microsoft.Data.Sqlite
Some gross hacks but will be good to find out if this works
with apple silicon.
* Enable selection of SQLite via installer UI (also quick install)
* Remove SqlServerDbProviderFactoryCreator to cleanup a TODO
* Move SQL Server support to its own class library
* Add persistence dependencies to Umbraco.CMS metapackage
* Bugfix packages delete query
Created invalid query for SQLite.
* Try out cypress tests Linux + SQLite
* Prevent cypress test artifact upload failure on attempt 2+
* LocalDb bugfixes
* Drop redundant enum
* Move SqlClient constant
* Misc whitespace
* Remove IsSqlCe extension (TODO: drop non 9->10 migrations later).
* Umbraco.Persistence.* -> Umbraco.Cms.Persistence.*
* Display quick install defaults and per provider default database name.
* Misc remove old comment
* little re-arrange
* Remove almost all usages of IsSqlite extension.
* visual adjustments
* Custom Database Configuration is last step and should then say Install.
* use text instead of disabled inputs
* move legend, rename to Install
* Update SqlMainDomLock to work without distributed locks.
* Added IDistributedLockingMechanism interface and in memory impl.
* Drop locking from ISqlSyntaxProvider & wire up scope to abstraction.
* Added SqlServerDistributedLockingMechanism
* Move distributed locking interfaces and exceptions to Core + xmldocs.
* Fix tests, Misc cleanup, Add SQL distributed locking integration tests
* Provide mechanism to specify DistributedLockingMechanism in config
(even if added by composer)
* Nomplementation -> NoImplementation
* Fix misleading comment
* Integration tests use SqlServerDistributedLockingMechanism when possible
* Handle up-gradable locks SqlServerDistributedLockingMechanism.
TODO: InMemoryDistributedLockingMechanism.
Note: Nuked SqlServerDistributedLockingMechanismTests, will still sleep
at night.
Is covered by Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.LockTests
* Make tests pass for InMemoryDistributedLockingMechanism, pretty hacky.
* Tweak constraints on WithCollectionBuilder so i can drop bad constructor
* Added SqliteDistributedLockingMechanism
* Dropped InMemoryDistributedMechanism + magic
InMemoryDistributedMechanism was pretty rubbish and now we have
a decent implementation for SQLite as we no longer block readers
see 8d1f42b.
Also drop the CollectionBuilder setup, instead do the same as we do
for syntax providers etc, it's more automagical so we never require an
explicit selection although we are allowing for it.
However keeping the optional IUmbracoBuilder constructor param for
CollectionBuilders as it's extremely useful.
* Fix quick install "" database name.
* Hide Database Configuration section when a connection string is pre-set.
Doesn't seem worth it to extract db name from connection string.
* Ensure wal test 2+
* Fix logging inconsistencies.
* Ensure in transaction when obtaining locks + no-op the SQLite read lock.
There's no point in running the query just to make a single test pass.
* Fix installer database display names
* Allow SQLite shared cache without losing deferred transactions
* Opt into shared cache for new SQLite databases + fix filename
* Fix misc inconsistency in .gitignore
* Prefer our interceptor interface
* Restore DEBUG_DATABASES code OnConnectionOpened in case it's used.
* Back to private cache.
* Added retry strategy for SQLite + refactor out SQL server specific stuff
* Fix SQL server tests.
* Misc - Orphaned comment, incorrect casing.
* InMemory SQLite test database & turn shared cache back on everywhere.
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2022-03-11 16:14:20 +00:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
variables:
|
2023-05-25 11:18:29 +02:00
|
|
|
nodeVersion: 18.16.0
|
2023-07-05 13:13:52 +02:00
|
|
|
dotnetVersion: 8.x
|
2022-10-05 12:14:43 +02:00
|
|
|
dotnetIncludePreviewVersions: true
|
2022-09-27 14:22:34 +02:00
|
|
|
solution: umbraco.sln
|
2022-05-19 10:25:44 +01:00
|
|
|
buildConfiguration: Release
|
2022-09-27 14:22:34 +02:00
|
|
|
UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042
|
|
|
|
|
DOTNET_NOLOGO: true
|
|
|
|
|
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
|
|
|
|
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
|
|
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
2021-03-22 14:20:30 +01:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
stages:
|
|
|
|
|
###############################################
|
|
|
|
|
## Build
|
|
|
|
|
###############################################
|
|
|
|
|
- stage: Build
|
2023-02-16 15:30:52 +01:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
variables:
|
|
|
|
|
npm_config_cache: $(Pipeline.Workspace)/.npm_client
|
2023-03-24 10:19:42 +01:00
|
|
|
NODE_OPTIONS: --max_old_space_size=16384
|
2022-05-19 10:25:44 +01:00
|
|
|
jobs:
|
|
|
|
|
- job: A
|
|
|
|
|
displayName: Build Umbraco CMS
|
|
|
|
|
pool:
|
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
steps:
|
2023-02-16 15:30:52 +01:00
|
|
|
- checkout: self
|
|
|
|
|
submodules: true
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: NodeTool@0
|
2022-09-27 14:22:34 +02:00
|
|
|
displayName: Use Node.js $(nodeVersion)
|
2022-05-19 10:25:44 +01:00
|
|
|
inputs:
|
|
|
|
|
versionSpec: $(nodeVersion)
|
|
|
|
|
- task: Cache@2
|
|
|
|
|
displayName: Cache node_modules
|
|
|
|
|
inputs:
|
2023-06-12 14:12:02 +02:00
|
|
|
key: '"npm_client" | "$(Agent.OS)"| $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Client/package-lock.json | $(Build.SourcesDirectory)/src/Umbraco.Web.UI.New.Client/package-lock.json'
|
2022-05-19 10:25:44 +01:00
|
|
|
restoreKeys: |
|
2022-05-23 08:56:50 +01:00
|
|
|
"npm_client" | "$(Agent.OS)"
|
|
|
|
|
"npm_client"
|
2022-05-19 10:25:44 +01:00
|
|
|
path: $(npm_config_cache)
|
|
|
|
|
- script: npm ci --no-fund --no-audit --prefer-offline
|
|
|
|
|
workingDirectory: src/Umbraco.Web.UI.Client
|
|
|
|
|
displayName: Run npm ci
|
|
|
|
|
- task: gulp@0
|
|
|
|
|
displayName: Run gulp build
|
|
|
|
|
inputs:
|
|
|
|
|
gulpFile: src/Umbraco.Web.UI.Client/gulpfile.js
|
|
|
|
|
targets: coreBuild
|
|
|
|
|
workingDirectory: src/Umbraco.Web.UI.Client
|
2023-03-24 10:19:42 +01:00
|
|
|
- script: npm ci --no-fund --no-audit --prefer-offline
|
|
|
|
|
workingDirectory: src/Umbraco.Web.UI.New.Client
|
|
|
|
|
displayName: Run npm ci
|
|
|
|
|
- script: npm run build:for:cms
|
|
|
|
|
displayName: Run New Backoffice Build
|
|
|
|
|
workingDirectory: src/Umbraco.Web.UI.New.Client
|
2023-06-02 11:46:47 +02:00
|
|
|
- script: npm run build
|
|
|
|
|
displayName: Run Login Build
|
|
|
|
|
workingDirectory: src/Umbraco.Web.UI.New.Client/apps/auth
|
2022-09-19 16:37:24 +02:00
|
|
|
- task: UseDotNet@2
|
2022-09-27 14:22:34 +02:00
|
|
|
displayName: Use .NET $(dotnetVersion)
|
2022-09-19 16:37:24 +02:00
|
|
|
inputs:
|
2022-09-27 14:22:34 +02:00
|
|
|
version: $(dotnetVersion)
|
2022-10-05 12:14:43 +02:00
|
|
|
includePreviewVersions: $(dotnetIncludePreviewVersions)
|
2022-09-27 14:22:34 +02:00
|
|
|
- task: DotNetCoreCLI@2
|
|
|
|
|
displayName: Run dotnet restore
|
|
|
|
|
inputs:
|
|
|
|
|
command: restore
|
|
|
|
|
projects: $(solution)
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: DotNetCoreCLI@2
|
|
|
|
|
displayName: Run dotnet build
|
|
|
|
|
inputs:
|
|
|
|
|
command: build
|
2022-09-27 14:22:34 +02:00
|
|
|
projects: $(solution)
|
|
|
|
|
arguments: '--configuration $(buildConfiguration) --no-restore -p:ContinuousIntegrationBuild=true'
|
2022-05-19 10:25:44 +01:00
|
|
|
- script: |
|
|
|
|
|
version="$(Build.BuildNumber)"
|
2023-03-16 20:32:54 +01:00
|
|
|
echo "Version: $version"
|
2021-03-23 08:51:48 +01:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
major="$(echo $version | cut -d '.' -f 1)"
|
2023-03-16 20:32:54 +01:00
|
|
|
echo "Major version: $major"
|
v10 SQLite support + distributed locking abstractions (#11922)
* Created Persistence.SQLite project skeleton.
* SQLite database initialization
* Various changes and hacks to make things work.
* WIP integration tests
* Fix thread safety tests
* Fix tests that relied on tie breaker sorting.
Spent a fair amount of time looking for a less lazy fix but gave up.
* Convert right join to left join ContentTypeRepository.PerformGetByQuery
SQLite doesn't support right join
* Fix test Can_Generate_Delete_SubQuery_Statement
Worth noting that NPoco.DatabaseTypes.SQLiteDatabaseType doesn't override
EscapeSqlIdentifier so NPoco will escape with [].
SQLite docs say > "A keyword enclosed in square brackets is an identifier.
This is not standard SQL.
This quoting mechanism is used by MS Access and SQL Server and is
included in SQLite for compatibility."
Also could have updated SqliteSyntaxProvider to match npoco but
decided against it.
* Fixes for paginated custom order by
* Fix tests broken by lack of unique indexes.
* Fix SqlServerTableByTableTest tests.
These tests didn't actually do anything as the tables already exist so schema creator just returned.
Did however point out that the default implementation for DoesTableExist just returns false so added a default naive implementation.
* Fix ValidateLoginSession - SelectTop must come later
* dry up database cleanup
* Fix up db migration tests.
We can't drop pk in sqlite without recreating table.
Test looks to be testing that add column works as intended which we can test.
* Prevent schema creation errors.
* SQLite ignore lock tests, WAL back on.
* Fix package schema tests
* Fix NPocoFetchTests - case sensitivity not under test
* Fix AdvancedMigrationTests (where possible)
Migrations probably need a good look later.
Maybe nuke old migrations and only support moving to v10 from v9.
If we do that can do some cleanup.
* Cleanup test database configuration
* Run integration tests against SQLite on build agent.
* Drop MS.Data.SQLite
System.Data.SQLite was quicker to roll out due to more CLR type mapping
* YAML
* Skip Umbraco.Tests.Integration.SqlCe
* Drop SqlServerTableByTable tests.
Until this week they did nothing anyway as they with NewSchemaPerTest
so the tests all passed as CreateTable was no op (already exists).
Also all of the tables are created in an empty database by SchemaValidationTest.cs
DatabaseSchemaCreation_Produces_DatabaseSchemaResult_With_Zero_Errors
* Might aswell run against macOS also.
* Copy azure pipelines task header layout
* Delete SQLCe projects
* Remove SQL CE specific code.
* Remove SQL CE NuSpec, template params, build script setup
* Delete umbraco-netcore-only.sln
* Add SkipTests solution configuration and use for codeql
* Remove reference to deleted nuspec file.
* Refactor ConnectionStrings WRT DataDirectory placeholder & ProviderName.
At this point you can try out SQLite support by setting the following
in appsettings.json and then completing the install process.
"ConnectionStrings": {
"umbracoDbDSN": "Data Source=|DataDirectory|/umbraco.sqlite",
"umbracoDbDSN_ProviderName": "System.Data.SQLite"
},
Not currently possible via installer UI without provider name pre-set in
configuration.
* Switch to Microsoft.Data.Sqlite
Some gross hacks but will be good to find out if this works
with apple silicon.
* Enable selection of SQLite via installer UI (also quick install)
* Remove SqlServerDbProviderFactoryCreator to cleanup a TODO
* Move SQL Server support to its own class library
* Add persistence dependencies to Umbraco.CMS metapackage
* Bugfix packages delete query
Created invalid query for SQLite.
* Try out cypress tests Linux + SQLite
* Prevent cypress test artifact upload failure on attempt 2+
* LocalDb bugfixes
* Drop redundant enum
* Move SqlClient constant
* Misc whitespace
* Remove IsSqlCe extension (TODO: drop non 9->10 migrations later).
* Umbraco.Persistence.* -> Umbraco.Cms.Persistence.*
* Display quick install defaults and per provider default database name.
* Misc remove old comment
* little re-arrange
* Remove almost all usages of IsSqlite extension.
* visual adjustments
* Custom Database Configuration is last step and should then say Install.
* use text instead of disabled inputs
* move legend, rename to Install
* Update SqlMainDomLock to work without distributed locks.
* Added IDistributedLockingMechanism interface and in memory impl.
* Drop locking from ISqlSyntaxProvider & wire up scope to abstraction.
* Added SqlServerDistributedLockingMechanism
* Move distributed locking interfaces and exceptions to Core + xmldocs.
* Fix tests, Misc cleanup, Add SQL distributed locking integration tests
* Provide mechanism to specify DistributedLockingMechanism in config
(even if added by composer)
* Nomplementation -> NoImplementation
* Fix misleading comment
* Integration tests use SqlServerDistributedLockingMechanism when possible
* Handle up-gradable locks SqlServerDistributedLockingMechanism.
TODO: InMemoryDistributedLockingMechanism.
Note: Nuked SqlServerDistributedLockingMechanismTests, will still sleep
at night.
Is covered by Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.LockTests
* Make tests pass for InMemoryDistributedLockingMechanism, pretty hacky.
* Tweak constraints on WithCollectionBuilder so i can drop bad constructor
* Added SqliteDistributedLockingMechanism
* Dropped InMemoryDistributedMechanism + magic
InMemoryDistributedMechanism was pretty rubbish and now we have
a decent implementation for SQLite as we no longer block readers
see 8d1f42b.
Also drop the CollectionBuilder setup, instead do the same as we do
for syntax providers etc, it's more automagical so we never require an
explicit selection although we are allowing for it.
However keeping the optional IUmbracoBuilder constructor param for
CollectionBuilders as it's extremely useful.
* Fix quick install "" database name.
* Hide Database Configuration section when a connection string is pre-set.
Doesn't seem worth it to extract db name from connection string.
* Ensure wal test 2+
* Fix logging inconsistencies.
* Ensure in transaction when obtaining locks + no-op the SQLite read lock.
There's no point in running the query just to make a single test pass.
* Fix installer database display names
* Allow SQLite shared cache without losing deferred transactions
* Opt into shared cache for new SQLite databases + fix filename
* Fix misc inconsistency in .gitignore
* Prefer our interceptor interface
* Restore DEBUG_DATABASES code OnConnectionOpened in case it's used.
* Back to private cache.
* Added retry strategy for SQLite + refactor out SQL server specific stuff
* Fix SQL server tests.
* Misc - Orphaned comment, incorrect casing.
* InMemory SQLite test database & turn shared cache back on everywhere.
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2022-03-11 16:14:20 +00:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
echo "##vso[task.setvariable variable=majorVersion;isOutput=true]$major"
|
|
|
|
|
displayName: Set major version
|
|
|
|
|
name: determineMajorVersion
|
2023-04-05 11:16:43 +02:00
|
|
|
- script: dotnet pack $(solution) --configuration $(buildConfiguration) --no-build --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg
|
|
|
|
|
displayName: Run dotnet pack
|
2022-05-25 10:48:45 +01:00
|
|
|
- script: |
|
|
|
|
|
sha="$(Build.SourceVersion)"
|
|
|
|
|
sha=${sha:0:7}
|
|
|
|
|
buildnumber="$(Build.BuildNumber)_$(Build.BuildId)_$sha"
|
|
|
|
|
echo "##vso[build.updatebuildnumber]$buildnumber"
|
|
|
|
|
displayName: Update build number
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
|
displayName: Publish nupkg
|
|
|
|
|
inputs:
|
|
|
|
|
targetPath: $(Build.ArtifactStagingDirectory)/nupkg
|
|
|
|
|
artifactName: nupkg
|
|
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
|
displayName: Publish build artifacts
|
|
|
|
|
inputs:
|
|
|
|
|
targetPath: $(Build.SourcesDirectory)
|
|
|
|
|
artifactName: build_output
|
v10 SQLite support + distributed locking abstractions (#11922)
* Created Persistence.SQLite project skeleton.
* SQLite database initialization
* Various changes and hacks to make things work.
* WIP integration tests
* Fix thread safety tests
* Fix tests that relied on tie breaker sorting.
Spent a fair amount of time looking for a less lazy fix but gave up.
* Convert right join to left join ContentTypeRepository.PerformGetByQuery
SQLite doesn't support right join
* Fix test Can_Generate_Delete_SubQuery_Statement
Worth noting that NPoco.DatabaseTypes.SQLiteDatabaseType doesn't override
EscapeSqlIdentifier so NPoco will escape with [].
SQLite docs say > "A keyword enclosed in square brackets is an identifier.
This is not standard SQL.
This quoting mechanism is used by MS Access and SQL Server and is
included in SQLite for compatibility."
Also could have updated SqliteSyntaxProvider to match npoco but
decided against it.
* Fixes for paginated custom order by
* Fix tests broken by lack of unique indexes.
* Fix SqlServerTableByTableTest tests.
These tests didn't actually do anything as the tables already exist so schema creator just returned.
Did however point out that the default implementation for DoesTableExist just returns false so added a default naive implementation.
* Fix ValidateLoginSession - SelectTop must come later
* dry up database cleanup
* Fix up db migration tests.
We can't drop pk in sqlite without recreating table.
Test looks to be testing that add column works as intended which we can test.
* Prevent schema creation errors.
* SQLite ignore lock tests, WAL back on.
* Fix package schema tests
* Fix NPocoFetchTests - case sensitivity not under test
* Fix AdvancedMigrationTests (where possible)
Migrations probably need a good look later.
Maybe nuke old migrations and only support moving to v10 from v9.
If we do that can do some cleanup.
* Cleanup test database configuration
* Run integration tests against SQLite on build agent.
* Drop MS.Data.SQLite
System.Data.SQLite was quicker to roll out due to more CLR type mapping
* YAML
* Skip Umbraco.Tests.Integration.SqlCe
* Drop SqlServerTableByTable tests.
Until this week they did nothing anyway as they with NewSchemaPerTest
so the tests all passed as CreateTable was no op (already exists).
Also all of the tables are created in an empty database by SchemaValidationTest.cs
DatabaseSchemaCreation_Produces_DatabaseSchemaResult_With_Zero_Errors
* Might aswell run against macOS also.
* Copy azure pipelines task header layout
* Delete SQLCe projects
* Remove SQL CE specific code.
* Remove SQL CE NuSpec, template params, build script setup
* Delete umbraco-netcore-only.sln
* Add SkipTests solution configuration and use for codeql
* Remove reference to deleted nuspec file.
* Refactor ConnectionStrings WRT DataDirectory placeholder & ProviderName.
At this point you can try out SQLite support by setting the following
in appsettings.json and then completing the install process.
"ConnectionStrings": {
"umbracoDbDSN": "Data Source=|DataDirectory|/umbraco.sqlite",
"umbracoDbDSN_ProviderName": "System.Data.SQLite"
},
Not currently possible via installer UI without provider name pre-set in
configuration.
* Switch to Microsoft.Data.Sqlite
Some gross hacks but will be good to find out if this works
with apple silicon.
* Enable selection of SQLite via installer UI (also quick install)
* Remove SqlServerDbProviderFactoryCreator to cleanup a TODO
* Move SQL Server support to its own class library
* Add persistence dependencies to Umbraco.CMS metapackage
* Bugfix packages delete query
Created invalid query for SQLite.
* Try out cypress tests Linux + SQLite
* Prevent cypress test artifact upload failure on attempt 2+
* LocalDb bugfixes
* Drop redundant enum
* Move SqlClient constant
* Misc whitespace
* Remove IsSqlCe extension (TODO: drop non 9->10 migrations later).
* Umbraco.Persistence.* -> Umbraco.Cms.Persistence.*
* Display quick install defaults and per provider default database name.
* Misc remove old comment
* little re-arrange
* Remove almost all usages of IsSqlite extension.
* visual adjustments
* Custom Database Configuration is last step and should then say Install.
* use text instead of disabled inputs
* move legend, rename to Install
* Update SqlMainDomLock to work without distributed locks.
* Added IDistributedLockingMechanism interface and in memory impl.
* Drop locking from ISqlSyntaxProvider & wire up scope to abstraction.
* Added SqlServerDistributedLockingMechanism
* Move distributed locking interfaces and exceptions to Core + xmldocs.
* Fix tests, Misc cleanup, Add SQL distributed locking integration tests
* Provide mechanism to specify DistributedLockingMechanism in config
(even if added by composer)
* Nomplementation -> NoImplementation
* Fix misleading comment
* Integration tests use SqlServerDistributedLockingMechanism when possible
* Handle up-gradable locks SqlServerDistributedLockingMechanism.
TODO: InMemoryDistributedLockingMechanism.
Note: Nuked SqlServerDistributedLockingMechanismTests, will still sleep
at night.
Is covered by Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.LockTests
* Make tests pass for InMemoryDistributedLockingMechanism, pretty hacky.
* Tweak constraints on WithCollectionBuilder so i can drop bad constructor
* Added SqliteDistributedLockingMechanism
* Dropped InMemoryDistributedMechanism + magic
InMemoryDistributedMechanism was pretty rubbish and now we have
a decent implementation for SQLite as we no longer block readers
see 8d1f42b.
Also drop the CollectionBuilder setup, instead do the same as we do
for syntax providers etc, it's more automagical so we never require an
explicit selection although we are allowing for it.
However keeping the optional IUmbracoBuilder constructor param for
CollectionBuilders as it's extremely useful.
* Fix quick install "" database name.
* Hide Database Configuration section when a connection string is pre-set.
Doesn't seem worth it to extract db name from connection string.
* Ensure wal test 2+
* Fix logging inconsistencies.
* Ensure in transaction when obtaining locks + no-op the SQLite read lock.
There's no point in running the query just to make a single test pass.
* Fix installer database display names
* Allow SQLite shared cache without losing deferred transactions
* Opt into shared cache for new SQLite databases + fix filename
* Fix misc inconsistency in .gitignore
* Prefer our interceptor interface
* Restore DEBUG_DATABASES code OnConnectionOpened in case it's used.
* Back to private cache.
* Added retry strategy for SQLite + refactor out SQL server specific stuff
* Fix SQL server tests.
* Misc - Orphaned comment, incorrect casing.
* InMemory SQLite test database & turn shared cache back on everywhere.
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2022-03-11 16:14:20 +00:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
- stage: Build_Docs
|
|
|
|
|
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.buildApiDocs}}))
|
|
|
|
|
displayName: Prepare API Documentation
|
|
|
|
|
dependsOn: Build
|
|
|
|
|
variables:
|
2022-10-05 12:14:43 +02:00
|
|
|
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['determineMajorVersion.majorVersion'] ]
|
2022-05-19 10:25:44 +01:00
|
|
|
jobs:
|
|
|
|
|
# C# API Reference
|
|
|
|
|
- job:
|
|
|
|
|
displayName: Build C# API Reference
|
|
|
|
|
pool:
|
|
|
|
|
vmImage: 'windows-latest'
|
|
|
|
|
steps:
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
|
displayName: Install DocFX
|
|
|
|
|
inputs:
|
2022-09-19 16:37:24 +02:00
|
|
|
targetType: inline
|
|
|
|
|
script: |
|
2023-01-16 16:10:06 +01:00
|
|
|
choco install docfx --version=2.59.4 -y
|
2022-09-19 16:37:24 +02:00
|
|
|
if ($lastexitcode -ne 0){
|
|
|
|
|
throw ("Error installing DocFX")
|
|
|
|
|
}
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: PowerShell@2
|
|
|
|
|
displayName: Generate metadata
|
|
|
|
|
inputs:
|
2022-09-19 16:37:24 +02:00
|
|
|
targetType: inline
|
|
|
|
|
script: |
|
|
|
|
|
docfx metadata "$(Build.SourcesDirectory)/build/csharp-docs/docfx.json"
|
|
|
|
|
if ($lastexitcode -ne 0){
|
|
|
|
|
throw ("Error generating metadata.")
|
|
|
|
|
}
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: PowerShell@2
|
|
|
|
|
displayName: Generate documentation
|
|
|
|
|
inputs:
|
2022-09-19 16:37:24 +02:00
|
|
|
targetType: inline
|
|
|
|
|
script: |
|
|
|
|
|
docfx build "$(Build.SourcesDirectory)/build/csharp-docs/docfx.json"
|
|
|
|
|
if ($lastexitcode -ne 0){
|
|
|
|
|
throw ("Error generating documentation.")
|
|
|
|
|
}
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: ArchiveFiles@2
|
|
|
|
|
displayName: Archive C# Docs
|
|
|
|
|
inputs:
|
2022-09-19 16:37:24 +02:00
|
|
|
rootFolderOrFile: $(Build.SourcesDirectory)/build/csharp-docs/_site
|
|
|
|
|
includeRootFolder: false
|
|
|
|
|
archiveFile: $(Build.ArtifactStagingDirectory)/csharp-docs.zip
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
|
displayName: Publish C# Docs
|
|
|
|
|
inputs:
|
2022-09-19 16:37:24 +02:00
|
|
|
targetPath: $(Build.ArtifactStagingDirectory)/csharp-docs.zip
|
|
|
|
|
artifact: csharp-docs
|
2021-03-23 19:28:15 +01:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
# js API Reference
|
|
|
|
|
- job:
|
|
|
|
|
displayName: Build js API Reference
|
|
|
|
|
pool:
|
|
|
|
|
vmImage: 'ubuntu-latest'
|
2023-06-12 14:12:02 +02:00
|
|
|
variables:
|
|
|
|
|
npm_config_cache: $(Pipeline.Workspace)/.npm_client
|
|
|
|
|
NODE_OPTIONS: --max_old_space_size=16384
|
|
|
|
|
BASE_PATH: /v$(umbracoMajorVersion)/ui
|
2022-05-19 10:25:44 +01:00
|
|
|
steps:
|
2023-06-12 14:12:02 +02:00
|
|
|
- checkout: self
|
|
|
|
|
submodules: true
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: NodeTool@0
|
2023-06-12 14:12:02 +02:00
|
|
|
displayName: Use Node.js $(nodeVersion)
|
2022-05-19 10:25:44 +01:00
|
|
|
inputs:
|
2023-06-12 14:12:02 +02:00
|
|
|
versionSpec: $(nodeVersion)
|
|
|
|
|
- task: Cache@2
|
|
|
|
|
displayName: Cache node_modules
|
|
|
|
|
inputs:
|
|
|
|
|
key: '"npm_client" | "$(Agent.OS)"| $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Client/package-lock.json | $(Build.SourcesDirectory)/src/Umbraco.Web.UI.New.Client/package-lock.json'
|
|
|
|
|
restoreKeys: |
|
|
|
|
|
"npm_client" | "$(Agent.OS)"
|
|
|
|
|
"npm_client"
|
|
|
|
|
path: $(npm_config_cache)
|
|
|
|
|
- script: npm ci --no-fund --no-audit --prefer-offline
|
|
|
|
|
workingDirectory: src/Umbraco.Web.UI.New.Client
|
|
|
|
|
displayName: Run npm ci
|
|
|
|
|
- script: npm run storybook:build
|
|
|
|
|
displayName: Build Storybook
|
|
|
|
|
env:
|
|
|
|
|
VITE_BASE_PATH: $(BASE_PATH)/
|
|
|
|
|
workingDirectory: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.New.Client
|
|
|
|
|
- script: sed -i "s|/umbraco/backoffice|$(BASE_PATH)/umbraco/backoffice|" assets/*.js
|
|
|
|
|
displayName: Replace BASE_PATH on assets
|
|
|
|
|
workingDirectory: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.New.Client/storybook-static
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: ArchiveFiles@2
|
|
|
|
|
displayName: Archive js Docs
|
|
|
|
|
inputs:
|
2023-06-12 14:12:02 +02:00
|
|
|
rootFolderOrFile: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.New.Client/storybook-static
|
2022-09-19 16:37:24 +02:00
|
|
|
includeRootFolder: false
|
|
|
|
|
archiveFile: $(Build.ArtifactStagingDirectory)/ui-docs.zip
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
|
displayName: Publish js Docs
|
|
|
|
|
inputs:
|
2022-09-19 16:37:24 +02:00
|
|
|
targetPath: $(Build.ArtifactStagingDirectory)/ui-docs.zip
|
|
|
|
|
artifact: ui-docs
|
2021-05-18 19:07:17 +02:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
###############################################
|
|
|
|
|
## Test
|
|
|
|
|
###############################################
|
|
|
|
|
- stage: Unit
|
|
|
|
|
displayName: Unit Tests
|
|
|
|
|
dependsOn: Build
|
|
|
|
|
jobs:
|
|
|
|
|
# Unit Tests
|
|
|
|
|
- job:
|
|
|
|
|
displayName: Unit Tests
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
Windows:
|
|
|
|
|
vmImage: 'windows-latest'
|
|
|
|
|
Linux:
|
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
macOS:
|
|
|
|
|
vmImage: 'macOS-latest'
|
|
|
|
|
pool:
|
|
|
|
|
vmImage: $(vmImage)
|
|
|
|
|
steps:
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
displayName: Download build artifacts
|
|
|
|
|
inputs:
|
|
|
|
|
artifact: build_output
|
|
|
|
|
path: $(Build.SourcesDirectory)
|
|
|
|
|
- task: UseDotNet@2
|
2022-09-27 14:22:34 +02:00
|
|
|
displayName: Use .NET $(dotnetVersion)
|
2022-05-19 10:25:44 +01:00
|
|
|
inputs:
|
2022-09-27 14:22:34 +02:00
|
|
|
version: $(dotnetVersion)
|
2022-10-05 12:14:43 +02:00
|
|
|
includePreviewVersions: $(dotnetIncludePreviewVersions)
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: DotNetCoreCLI@2
|
|
|
|
|
displayName: Run dotnet test
|
|
|
|
|
inputs:
|
|
|
|
|
command: test
|
|
|
|
|
projects: '**/*.Tests.UnitTests.csproj'
|
2022-09-27 14:22:34 +02:00
|
|
|
arguments: '--configuration $(buildConfiguration) --no-build'
|
2022-05-19 10:25:44 +01:00
|
|
|
testRunTitle: Unit Tests - $(Agent.OS)
|
2021-03-18 14:48:22 +01:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
- stage: Integration
|
|
|
|
|
displayName: Integration Tests
|
|
|
|
|
dependsOn: Build
|
|
|
|
|
jobs:
|
|
|
|
|
# Integration Tests (SQLite)
|
|
|
|
|
- job:
|
|
|
|
|
displayName: Integration Tests (SQLite)
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
Windows:
|
|
|
|
|
vmImage: 'windows-latest'
|
|
|
|
|
Linux:
|
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
macOS:
|
|
|
|
|
vmImage: 'macOS-latest'
|
|
|
|
|
pool:
|
|
|
|
|
vmImage: $(vmImage)
|
|
|
|
|
steps:
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
displayName: Download build artifacts
|
|
|
|
|
inputs:
|
|
|
|
|
artifact: build_output
|
|
|
|
|
path: $(Build.SourcesDirectory)
|
|
|
|
|
- task: UseDotNet@2
|
2022-09-27 14:22:34 +02:00
|
|
|
displayName: Use .NET $(dotnetVersion)
|
2022-05-19 10:25:44 +01:00
|
|
|
inputs:
|
2022-09-27 14:22:34 +02:00
|
|
|
version: $(dotnetVersion)
|
2022-10-05 12:14:43 +02:00
|
|
|
includePreviewVersions: $(dotnetIncludePreviewVersions)
|
2022-05-19 10:25:44 +01:00
|
|
|
- task: DotNetCoreCLI@2
|
|
|
|
|
displayName: Run dotnet test
|
|
|
|
|
inputs:
|
|
|
|
|
command: test
|
|
|
|
|
projects: '**/*.Tests.Integration.csproj'
|
2022-09-27 14:22:34 +02:00
|
|
|
arguments: '--configuration $(buildConfiguration) --no-build'
|
2022-05-19 10:25:44 +01:00
|
|
|
testRunTitle: Integration Tests SQLite - $(Agent.OS)
|
|
|
|
|
env:
|
|
|
|
|
Tests__Database__DatabaseType: 'Sqlite'
|
2022-10-05 12:14:43 +02:00
|
|
|
Umbraco__CMS__Global__MainDomLock: 'FileSystemMainDomLock'
|
2021-03-18 14:48:22 +01:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
# Integration Tests (SQL Server)
|
|
|
|
|
- job:
|
2022-05-24 08:55:54 +01:00
|
|
|
timeoutInMinutes: 120
|
2022-05-19 10:25:44 +01:00
|
|
|
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.sqlServerIntegrationTests}})
|
|
|
|
|
displayName: Integration Tests (SQL Server)
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
Windows:
|
|
|
|
|
vmImage: 'windows-latest'
|
|
|
|
|
testDb: LocalDb
|
|
|
|
|
connectionString: N/A
|
|
|
|
|
Linux:
|
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
testDb: SqlServer
|
2023-05-15 12:43:13 +02:00
|
|
|
connectionString: 'Server=localhost,1433;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=true'
|
2022-05-19 10:25:44 +01:00
|
|
|
pool:
|
|
|
|
|
vmImage: $(vmImage)
|
2022-09-27 14:22:34 +02:00
|
|
|
variables:
|
|
|
|
|
SA_PASSWORD: UmbracoIntegration123!
|
2022-05-19 10:25:44 +01:00
|
|
|
steps:
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
displayName: Download build artifacts
|
|
|
|
|
inputs:
|
|
|
|
|
artifact: build_output
|
|
|
|
|
path: $(Build.SourcesDirectory)
|
2022-10-19 10:46:32 +02:00
|
|
|
- task: UseDotNet@2
|
|
|
|
|
displayName: Use .NET $(dotnetVersion)
|
|
|
|
|
inputs:
|
|
|
|
|
version: $(dotnetVersion)
|
|
|
|
|
includePreviewVersions: $(dotnetIncludePreviewVersions)
|
2022-05-19 10:25:44 +01:00
|
|
|
- powershell: sqllocaldb start mssqllocaldb
|
|
|
|
|
displayName: Start localdb (Windows only)
|
|
|
|
|
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
|
2022-09-19 16:37:24 +02:00
|
|
|
- powershell: docker run --name mssql -d -p 1433:1433 -e ACCEPT_EULA=Y -e SA_PASSWORD=$(SA_PASSWORD) -e MSSQL_PID=Developer mcr.microsoft.com/mssql/server:2019-latest
|
2022-05-19 10:25:44 +01:00
|
|
|
displayName: Start SQL Server (Linux only)
|
|
|
|
|
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
|
|
|
|
|
- task: DotNetCoreCLI@2
|
|
|
|
|
displayName: Run dotnet test
|
|
|
|
|
inputs:
|
|
|
|
|
command: test
|
|
|
|
|
projects: '**/*.Tests.Integration.csproj'
|
2022-09-27 14:22:34 +02:00
|
|
|
arguments: '--configuration $(buildConfiguration) --no-build'
|
2022-05-19 10:25:44 +01:00
|
|
|
testRunTitle: Integration Tests SQL Server - $(Agent.OS)
|
|
|
|
|
env:
|
|
|
|
|
Tests__Database__DatabaseType: $(testDb)
|
|
|
|
|
Tests__Database__SQLServerMasterConnectionString: $(connectionString)
|
2022-10-05 12:14:43 +02:00
|
|
|
Umbraco__CMS__Global__MainDomLock: 'SqlMainDomLock'
|
2021-03-18 14:48:22 +01:00
|
|
|
|
2023-04-11 15:34:59 +02:00
|
|
|
# - stage: E2E
|
|
|
|
|
# variables:
|
|
|
|
|
# npm_config_cache: $(Pipeline.Workspace)/.npm_e2e
|
|
|
|
|
# displayName: E2E Tests
|
|
|
|
|
# dependsOn: Build
|
|
|
|
|
# jobs:
|
|
|
|
|
# # E2E Tests
|
|
|
|
|
# - job:
|
|
|
|
|
# displayName: E2E Tests
|
|
|
|
|
# variables:
|
|
|
|
|
# Umbraco__CMS__Unattended__UnattendedUserName: Playwright Test
|
|
|
|
|
# Umbraco__CMS__Unattended__UnattendedUserPassword: UmbracoAcceptance123!
|
|
|
|
|
# Umbraco__CMS__Unattended__UnattendedUserEmail: playwright@umbraco.com
|
|
|
|
|
# ASPNETCORE_URLS: https://localhost:8443
|
|
|
|
|
# strategy:
|
|
|
|
|
# matrix:
|
|
|
|
|
# Linux:
|
|
|
|
|
# vmImage: 'ubuntu-latest'
|
|
|
|
|
# dockerfile: umbraco-linux.docker
|
|
|
|
|
# dockerImageName: umbraco-linux
|
|
|
|
|
# Windows:
|
|
|
|
|
# vmImage: 'windows-latest'
|
|
|
|
|
# DOTNET_GENERATE_ASPNET_CERTIFICATE: true # Automatically generate HTTPS development certificate on Windows
|
|
|
|
|
# # Enable console logging in Release mode
|
|
|
|
|
# Serilog__WriteTo__0__Name: Async
|
|
|
|
|
# Serilog__WriteTo__0__Args__configure__0__Name: Console
|
|
|
|
|
# # Set unattended install settings
|
|
|
|
|
# Umbraco__CMS__Unattended__InstallUnattended: true
|
|
|
|
|
# Umbraco__CMS__Global__InstallMissingDatabase: true
|
|
|
|
|
# UmbracoDatabaseServer: (LocalDB)\MSSQLLocalDB
|
|
|
|
|
# UmbracoDatabaseName: Playwright
|
|
|
|
|
# ConnectionStrings__umbracoDbDSN: Server=$(UmbracoDatabaseServer);Database=$(UmbracoDatabaseName);Integrated Security=true;
|
|
|
|
|
# # Custom Umbraco settings
|
|
|
|
|
# Umbraco__CMS__Global__VersionCheckPeriod: 0
|
|
|
|
|
# Umbraco__CMS__Global__UseHttps: true
|
|
|
|
|
# Umbraco__CMS__HealthChecks__Notification__Enabled: false
|
|
|
|
|
# Umbraco__CMS__KeepAlive__DisableKeepAliveTask: true
|
|
|
|
|
# pool:
|
|
|
|
|
# vmImage: $(vmImage)
|
|
|
|
|
# steps:
|
|
|
|
|
# - task: DownloadPipelineArtifact@2
|
|
|
|
|
# displayName: Download nupkg
|
|
|
|
|
# inputs:
|
|
|
|
|
# artifact: nupkg
|
|
|
|
|
# path: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/misc/nupkg
|
|
|
|
|
# - task: NodeTool@0
|
|
|
|
|
# displayName: Use Node.js $(nodeVersion)
|
|
|
|
|
# inputs:
|
|
|
|
|
# versionSpec: $(nodeVersion)
|
|
|
|
|
# - task: Cache@2
|
|
|
|
|
# displayName: Cache node_modules
|
|
|
|
|
# inputs:
|
|
|
|
|
# key: '"npm_e2e" | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json'
|
|
|
|
|
# restoreKeys: |
|
|
|
|
|
# "npm_e2e" | "$(Agent.OS)"
|
|
|
|
|
# "npm_e2e"
|
|
|
|
|
# path: $(npm_config_cache)
|
|
|
|
|
# - pwsh: |
|
|
|
|
|
# New-Item -Path "." -Name ".env" -ItemType "file" -Value "UMBRACO_USER_LOGIN=$(Umbraco__CMS__Unattended__UnattendedUserEmail)
|
|
|
|
|
# UMBRACO_USER_PASSWORD=$(Umbraco__CMS__Unattended__UnattendedUserPassword)
|
|
|
|
|
# URL=$(ASPNETCORE_URLS)"
|
|
|
|
|
# displayName: Generate .env
|
|
|
|
|
# workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/
|
|
|
|
|
# - script: npm ci --no-fund --no-audit --prefer-offline
|
|
|
|
|
# workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/
|
|
|
|
|
# displayName: Run npm ci
|
|
|
|
|
# - pwsh: sqllocaldb start mssqllocaldb
|
|
|
|
|
# displayName: Start localdb (Windows only)
|
|
|
|
|
# condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
|
|
|
|
|
# - pwsh: Invoke-Sqlcmd -Query "CREATE DATABASE $env:UmbracoDatabaseName" -ServerInstance $env:UmbracoDatabaseServer
|
|
|
|
|
# displayName: Create database (Windows only)
|
|
|
|
|
# condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
|
|
|
|
|
# - task: UseDotNet@2
|
|
|
|
|
# displayName: Use .NET $(dotnetVersion)
|
|
|
|
|
# inputs:
|
|
|
|
|
# version: $(dotnetVersion)
|
|
|
|
|
# includePreviewVersions: $(dotnetIncludePreviewVersions)
|
|
|
|
|
# - pwsh: |
|
|
|
|
|
# $sha = 'g$(Build.SourceVersion)'.substring(0, 8)
|
|
|
|
|
# docker build -t $(dockerImageName):$sha -f $(dockerfile) .
|
|
|
|
|
# mkdir -p $(Build.ArtifactStagingDirectory)/docker-images
|
|
|
|
|
# docker save -o $(Build.ArtifactStagingDirectory)/docker-images/$(dockerImageName).$sha.tar $(dockerImageName):$sha
|
|
|
|
|
# dotnet dev-certs https -ep ${HOME}/.aspnet/https/aspnetapp.pfx -p $(Umbraco__CMS__Unattended__UnattendedUserPassword)
|
|
|
|
|
# docker run --name $(dockerImageName) -dp 8080:5000 -dp 8443:5001 -e UMBRACO__CMS__GLOBAL__ID=$(UMBRACO__CMS__GLOBAL__ID) -e ASPNETCORE_Kestrel__Certificates__Default__Password="$(Umbraco__CMS__Unattended__UnattendedUserPassword)" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v ${HOME}/.aspnet/https:/https/ $(dockerImageName):$sha
|
|
|
|
|
# docker ps
|
|
|
|
|
# condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
|
|
|
|
|
# displayName: Build and run container (Linux only)
|
|
|
|
|
# workingDirectory: tests/Umbraco.Tests.AcceptanceTest/misc
|
|
|
|
|
# - pwsh: |
|
|
|
|
|
# dotnet new --install ./nupkg/Umbraco.Templates.*.nupkg
|
|
|
|
|
# dotnet new umbraco --name Playwright --no-restore --output .
|
|
|
|
|
# dotnet restore --configfile ./nuget.config
|
|
|
|
|
# dotnet build --configuration $(buildConfiguration) --no-restore
|
|
|
|
|
# dotnet dev-certs https
|
|
|
|
|
# $process = Start-Process -FilePath "dotnet" -ArgumentList "run --configuration $(buildConfiguration) --no-build --no-launch-profile 2>&1" -PassThru -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log
|
|
|
|
|
# Write-Host "##vso[task.setvariable variable=AcceptanceTestProcessId]$($process.Id)"
|
|
|
|
|
# condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
|
|
|
|
|
# displayName: Build and run app (Windows only)
|
|
|
|
|
# workingDirectory: tests/Umbraco.Tests.AcceptanceTest/misc
|
|
|
|
|
# - pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS)
|
|
|
|
|
# displayName: Wait for app
|
|
|
|
|
# workingDirectory: tests/Umbraco.Tests.AcceptanceTest
|
|
|
|
|
# - pwsh: npx playwright install --with-deps
|
|
|
|
|
# displayName: Install Playwright
|
|
|
|
|
# workingDirectory: tests/Umbraco.Tests.AcceptanceTest
|
|
|
|
|
# - pwsh: npm run test --ignore-certificate-errors
|
|
|
|
|
# displayName: Run Playwright (Desktop)
|
|
|
|
|
# continueOnError: true
|
|
|
|
|
# workingDirectory: tests/Umbraco.Tests.AcceptanceTest
|
|
|
|
|
# env:
|
|
|
|
|
# CI: true
|
|
|
|
|
# CommitId: $(Build.SourceVersion)
|
|
|
|
|
# AgentOs: $(Agent.OS)
|
|
|
|
|
# - pwsh: |
|
|
|
|
|
# docker logs $(dockerImageName) > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1
|
|
|
|
|
# docker stop $(dockerImageName)
|
|
|
|
|
# condition: eq(variables['Agent.OS'], 'Linux')
|
|
|
|
|
# displayName: Stop app (Linux only)
|
|
|
|
|
# - pwsh: Stop-Process $env:AcceptanceTestProcessId
|
|
|
|
|
# condition: eq(variables['Agent.OS'], 'Windows_NT')
|
|
|
|
|
# displayName: Stop app (Windows only)
|
|
|
|
|
# - task: PowerShell@2
|
|
|
|
|
# displayName: Check if artifacts folder exists
|
|
|
|
|
# inputs:
|
|
|
|
|
# targetType: inline
|
|
|
|
|
# script: |
|
|
|
|
|
# $MyVariable = Test-Path -Path $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results
|
|
|
|
|
# Write-Host "##vso[task.setvariable variable=resultFolderExists;]$MyVariable"
|
|
|
|
|
# - task: CopyFiles@2
|
|
|
|
|
# displayName: Prepare artifacts
|
|
|
|
|
# condition: eq(variables.resultFolderExists, 'True')
|
|
|
|
|
# inputs:
|
|
|
|
|
# sourceFolder: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results/
|
|
|
|
|
# targetFolder: $(Build.ArtifactStagingDirectory)/playwright
|
|
|
|
|
# - task: PublishPipelineArtifact@1
|
|
|
|
|
# condition: always()
|
|
|
|
|
# displayName: Publish test artifacts
|
|
|
|
|
# inputs:
|
|
|
|
|
# targetPath: $(Build.ArtifactStagingDirectory)
|
|
|
|
|
# artifact: 'E2E artifacts - $(Agent.OS) - Attempt #$(System.JobAttempt)'
|
2021-06-24 14:55:16 +02:00
|
|
|
|
2022-10-13 15:29:38 +02:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
###############################################
|
|
|
|
|
## Release
|
|
|
|
|
###############################################
|
|
|
|
|
- stage: Deploy_MyGet
|
|
|
|
|
displayName: MyGet pre-release
|
|
|
|
|
dependsOn:
|
|
|
|
|
- Unit
|
|
|
|
|
- Integration
|
|
|
|
|
# - E2E # TODO: Enable when stable.
|
|
|
|
|
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.myGetDeploy}}))
|
|
|
|
|
jobs:
|
|
|
|
|
- job:
|
|
|
|
|
displayName: Push to pre-release feed
|
|
|
|
|
steps:
|
|
|
|
|
- checkout: none
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
displayName: Download nupkg
|
|
|
|
|
inputs:
|
|
|
|
|
artifact: nupkg
|
|
|
|
|
path: $(Build.ArtifactStagingDirectory)/nupkg
|
2022-10-19 12:51:26 +02:00
|
|
|
- task: NuGetCommand@2
|
|
|
|
|
displayName: NuGet push
|
|
|
|
|
inputs:
|
|
|
|
|
command: 'push'
|
|
|
|
|
packagesToPush: $(Build.ArtifactStagingDirectory)/**/*.nupkg
|
|
|
|
|
nuGetFeedType: 'external'
|
|
|
|
|
publishFeedCredentials: 'MyGet - Pre-releases'
|
2022-05-19 10:25:44 +01:00
|
|
|
- stage: Deploy_NuGet
|
|
|
|
|
displayName: NuGet release
|
|
|
|
|
dependsOn:
|
|
|
|
|
- Deploy_MyGet
|
2022-08-03 10:45:11 +02:00
|
|
|
- Build_Docs
|
2022-05-19 10:25:44 +01:00
|
|
|
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.nuGetDeploy}}))
|
|
|
|
|
jobs:
|
|
|
|
|
- job:
|
|
|
|
|
displayName: Push to NuGet
|
|
|
|
|
steps:
|
|
|
|
|
- checkout: none
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
displayName: Download nupkg
|
|
|
|
|
inputs:
|
|
|
|
|
artifact: nupkg
|
|
|
|
|
path: $(Build.ArtifactStagingDirectory)/nupkg
|
2022-10-05 12:14:43 +02:00
|
|
|
- task: NuGetCommand@2
|
|
|
|
|
displayName: NuGet push
|
2022-05-19 10:25:44 +01:00
|
|
|
inputs:
|
2022-10-19 14:32:05 +02:00
|
|
|
command: 'push'
|
|
|
|
|
packagesToPush: $(Build.ArtifactStagingDirectory)/**/*.nupkg
|
|
|
|
|
nuGetFeedType: 'external'
|
|
|
|
|
publishFeedCredentials: 'NuGet - Umbraco.*'
|
2021-03-18 14:48:22 +01:00
|
|
|
|
2022-05-19 10:25:44 +01:00
|
|
|
- stage: Upload_API_Docs
|
|
|
|
|
pool:
|
|
|
|
|
vmImage: 'windows-latest' # Apparently AzureFileCopy is windows only :(
|
|
|
|
|
variables:
|
|
|
|
|
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['determineMajorVersion.majorVersion'] ]
|
|
|
|
|
displayName: Upload API Documention
|
|
|
|
|
dependsOn:
|
2023-06-20 13:56:45 +02:00
|
|
|
- Build
|
2023-06-12 14:12:02 +02:00
|
|
|
- Build_Docs
|
2023-06-20 13:56:45 +02:00
|
|
|
- Deploy_MyGet # Change to "Deploy_Nuget" after release of v14
|
2022-05-19 10:25:44 +01:00
|
|
|
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.uploadApiDocs}}))
|
|
|
|
|
jobs:
|
|
|
|
|
- job:
|
|
|
|
|
displayName: Upload C# Docs
|
|
|
|
|
steps:
|
|
|
|
|
- checkout: none
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
displayName: Download artifact
|
|
|
|
|
inputs:
|
|
|
|
|
artifact: csharp-docs
|
|
|
|
|
path: $(Build.SourcesDirectory)
|
|
|
|
|
- task: ExtractFiles@1
|
|
|
|
|
inputs:
|
|
|
|
|
archiveFilePatterns: $(Build.SourcesDirectory)/csharp-docs.zip
|
|
|
|
|
destinationFolder: $(Build.ArtifactStagingDirectory)/csharp-docs
|
|
|
|
|
- task: AzureFileCopy@4
|
|
|
|
|
displayName: 'Copy C# Docs to blob storage'
|
|
|
|
|
inputs:
|
|
|
|
|
SourcePath: '$(Build.ArtifactStagingDirectory)/csharp-docs/*'
|
|
|
|
|
azureSubscription: umbraco-storage
|
|
|
|
|
Destination: AzureBlob
|
|
|
|
|
storage: umbracoapidocs
|
|
|
|
|
ContainerName: '$web'
|
|
|
|
|
BlobPrefix: v$(umbracoMajorVersion)/csharp
|
|
|
|
|
- job:
|
|
|
|
|
displayName: Upload js Docs
|
|
|
|
|
steps:
|
|
|
|
|
- checkout: none
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
displayName: Download artifact
|
|
|
|
|
inputs:
|
|
|
|
|
artifact: ui-docs
|
|
|
|
|
path: $(Build.SourcesDirectory)
|
|
|
|
|
- task: ExtractFiles@1
|
|
|
|
|
inputs:
|
|
|
|
|
archiveFilePatterns: $(Build.SourcesDirectory)/ui-docs.zip
|
|
|
|
|
destinationFolder: $(Build.ArtifactStagingDirectory)/ui-docs
|
|
|
|
|
- task: AzureFileCopy@4
|
|
|
|
|
displayName: 'Copy UI Docs to blob storage'
|
|
|
|
|
inputs:
|
|
|
|
|
SourcePath: '$(Build.ArtifactStagingDirectory)/ui-docs/*'
|
|
|
|
|
azureSubscription: umbraco-storage
|
|
|
|
|
Destination: AzureBlob
|
|
|
|
|
storage: umbracoapidocs
|
|
|
|
|
ContainerName: '$web'
|
|
|
|
|
BlobPrefix: v$(umbracoMajorVersion)/ui
|