Skip to content

Commit 69f8e54

Browse files
Paul Johnsonronaldbarendse
andauthored
Restore BelleBuild target (for back-office assets) and use npm ci (#11364)
Co-authored-by: Ronald Barendse <[email protected]>
1 parent ad66d61 commit 69f8e54

File tree

14 files changed

+38860
-5739
lines changed

14 files changed

+38860
-5739
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ There are two big areas that you should know about:
159159
You may need to run the following commands to set up gulp properly:
160160
```
161161
npm cache clean --force
162-
npm install
162+
npm ci
163163
npm run build
164164
```
165165
The caching for the back office has been described as 'aggressive' so we often find it's best when making back office changes to disable caching in the browser to help you to see the changes you're making.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ cypress.env.json
9090
tests/Umbraco.Tests.AcceptanceTest/cypress/screenshots/
9191
tests/Umbraco.Tests.AcceptanceTest/cypress/support/chainable.ts
9292
tests/Umbraco.Tests.AcceptanceTest/cypress/videos/
93-
tests/Umbraco.Tests.AcceptanceTest/package-lock.json
9493
tests/Umbraco.Tests.Integration.SqlCe/DatabaseContextTests.sdf
9594
tests/Umbraco.Tests.Integration.SqlCe/umbraco/Data/TEMP/
9695
tests/Umbraco.Tests.Integration/TEMP/*

build/azure-pipelines.yml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ variables:
33
buildConfiguration: Release
44
SA_PASSWORD: UmbracoIntegration123!
55
UmbracoBuild: AzurePipeline
6+
nodeVersion: 14.18.1
67
resources:
78
containers:
89
- container: mssql
@@ -194,12 +195,13 @@ stages:
194195
# command: build
195196
# projects: '**/Umbraco.Web.UI.csproj'
196197
- task: NodeTool@0
197-
displayName: Use Node 11.x
198+
displayName: Use Node $(nodeVersion)
198199
inputs:
199-
versionSpec: 11.x
200+
versionSpec: $(nodeVersion)
200201
- task: Npm@1
201-
displayName: npm install (Client)
202+
displayName: npm ci (Client)
202203
inputs:
204+
command: ci
203205
workingDir: src\Umbraco.Web.UI.Client
204206
verbose: false
205207
- task: gulp@0
@@ -220,8 +222,9 @@ stages:
220222
@{ username = $env:Umbraco__CMS__Unattended__UnattendedUserEmail; password = $env:Umbraco__CMS__Unattended__UnattendedUserPassword } | ConvertTo-Json | Set-Content -Path "tests\Umbraco.Tests.AcceptanceTest\cypress.env.json"
221223
- task: Npm@1
222224
name: PrepareTask
223-
displayName: npm install (AcceptanceTest)
225+
displayName: npm ci (AcceptanceTest)
224226
inputs:
227+
command: ci
225228
workingDir: 'tests\Umbraco.Tests.AcceptanceTest'
226229
- task: Npm@1
227230
displayName: Run Cypress (Desktop)
@@ -287,12 +290,13 @@ stages:
287290
DBNAME: $(UmbracoDatabaseName)
288291
SA_PASSWORD: $(SA_PASSWORD)
289292
- task: NodeTool@0
290-
displayName: Use Node 11.x
293+
displayName: Use Node $(nodeVersion)
291294
inputs:
292-
versionSpec: 11.x
295+
versionSpec: $(nodeVersion)
293296
- task: Npm@1
294-
displayName: npm install (Client)
297+
displayName: npm ci (Client)
295298
inputs:
299+
command: ci
296300
workingDir: src/Umbraco.Web.UI.Client
297301
verbose: false
298302
- task: gulp@0
@@ -301,11 +305,16 @@ stages:
301305
gulpFile: src/Umbraco.Web.UI.Client/gulpfile.js
302306
targets: build
303307
workingDirectory: src/Umbraco.Web.UI.Client
308+
- task: DotNetCoreCLI@2
309+
displayName: dotnet build
310+
inputs:
311+
command: build
312+
projects: src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
304313
- task: Bash@3
305314
displayName: dotnet run
306315
inputs:
307316
targetType: 'inline'
308-
script: 'nohup dotnet run -p ./src/Umbraco.Web.UI/Umbraco.Web.UI.csproj &'
317+
script: 'nohup dotnet run --no-build -p ./src/Umbraco.Web.UI/ > $(Build.ArtifactStagingDirectory)/dotnet_run_log_linux.txt &'
309318
- task: Bash@3
310319
displayName: Generate Cypress.env.json
311320
inputs:
@@ -316,8 +325,9 @@ stages:
316325
PASSWORD: $(Umbraco__CMS__Unattended__UnattendedUserPassword)
317326
- task: Npm@1
318327
name: PrepareTask
319-
displayName: npm install (AcceptanceTest)
328+
displayName: npm ci (AcceptanceTest)
320329
inputs:
330+
command: ci
321331
workingDir: 'tests/Umbraco.Tests.AcceptanceTest'
322332
- task: Npm@1
323333
displayName: Run Cypress (Desktop)
@@ -327,7 +337,6 @@ stages:
327337
workingDir: tests/Umbraco.Tests.AcceptanceTest
328338
command: 'custom'
329339
customCommand: 'run test -- --reporter junit --reporter-options "mochaFile=results/test-output-D-[hash].xml,toConsole=true" --config="viewportHeight=1600,viewportWidth=2560,screenshotsFolder=cypress/artifacts/desktop/screenshots,videosFolder=cypress/artifacts/desktop/videos,videoUploadOnPasses=false"'
330-
331340
- task: PublishTestResults@2
332341
condition: always()
333342
inputs:
@@ -356,6 +365,12 @@ stages:
356365
inputs:
357366
targetPath: '$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/cypress/artifacts'
358367
artifact: 'Test artifacts - Linux'
368+
- task: PublishPipelineArtifact@1
369+
displayName: "Publish run log"
370+
condition: failed()
371+
inputs:
372+
targetPath: '$(Build.ArtifactStagingDirectory)/dotnet_run_log_linux.txt'
373+
artifact: Test Run logs - Linux
359374
- stage: Artifacts
360375
dependsOn: []
361376
jobs:
@@ -443,12 +458,13 @@ stages:
443458
444459
$ubuild.CompileJsonSchema()
445460
- task: NodeTool@0
446-
displayName: Use Node 11.x
461+
displayName: Use Node $(nodeVersion)
447462
inputs:
448-
versionSpec: 11.x
463+
versionSpec: $(nodeVersion)
449464
- task: Npm@1
450-
displayName: npm install
465+
displayName: npm ci (Client)
451466
inputs:
467+
command: ci
452468
workingDir: src\Umbraco.Web.UI.Client
453469
verbose: false
454470
- task: gulp@0

build/build.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@
119119
npm cache clean --force >> $log 2>&1
120120
$error.Clear() # that one can fail 'cos security bug - ignore
121121

122-
Write-Output "### npm install" >> $log 2>&1
123-
npm install >> $log 2>&1
122+
Write-Output "### npm ci" >> $log 2>&1
123+
npm ci >> $log 2>&1
124124
Write-Output ">> $? $($error.Count)" >> $log 2>&1
125-
# Don't really care about the messages from npm install making us think there are errors
125+
# Don't really care about the messages from npm ci making us think there are errors
126126
$error.Clear()
127127

128128
Write-Output "### gulp build for version $($this.Version.Release)" >> $log 2>&1
@@ -489,7 +489,7 @@
489489
cd $src\Umbraco.Web.UI.Docs
490490

491491
"Generating the docs and waiting before executing the next commands"
492-
& npm install
492+
& npm ci
493493
& npx gulp docs
494494

495495
Pop-Location

src/Umbraco.Web.UI.Client/gulpfile.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ const { watchTask } = require('./gulp/tasks/watchTask');
2424
// set default current compile mode:
2525
config.compile.current = config.compile.build;
2626

27+
const coreBuild = parallel(dependencies, js, less, views);
28+
2729
// ***********************************************************
2830
// These Exports are the new way of defining Tasks in Gulp 4.x
2931
// ***********************************************************
30-
exports.build = series(parallel(dependencies, js, less, views), testUnit);
31-
exports.dev = series(setDevelopmentMode, parallel(dependencies, js, less, views), runUnitTestServer, watchTask);
32+
33+
exports.build = series(coreBuild, testUnit);
34+
exports.coreBuild = coreBuild;
35+
exports.dev = series(setDevelopmentMode, coreBuild, runUnitTestServer, watchTask);
3236
exports.watch = series(watchTask);
3337
//
3438
exports.runTests = series(setTestMode, series(js, testUnit));

0 commit comments

Comments
 (0)