Skip to content

Commit

Permalink
Restore BelleBuild target (for back-office assets) and use npm ci (um…
Browse files Browse the repository at this point in the history
…braco#11364)

Co-authored-by: Ronald Barendse <[email protected]>
  • Loading branch information
Paul Johnson and ronaldbarendse authored Oct 19, 2021
1 parent ad66d61 commit 69f8e54
Show file tree
Hide file tree
Showing 14 changed files with 38,860 additions and 5,739 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ There are two big areas that you should know about:
You may need to run the following commands to set up gulp properly:
```
npm cache clean --force
npm install
npm ci
npm run build
```
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.
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ cypress.env.json
tests/Umbraco.Tests.AcceptanceTest/cypress/screenshots/
tests/Umbraco.Tests.AcceptanceTest/cypress/support/chainable.ts
tests/Umbraco.Tests.AcceptanceTest/cypress/videos/
tests/Umbraco.Tests.AcceptanceTest/package-lock.json
tests/Umbraco.Tests.Integration.SqlCe/DatabaseContextTests.sdf
tests/Umbraco.Tests.Integration.SqlCe/umbraco/Data/TEMP/
tests/Umbraco.Tests.Integration/TEMP/*
Expand Down
42 changes: 29 additions & 13 deletions build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ variables:
buildConfiguration: Release
SA_PASSWORD: UmbracoIntegration123!
UmbracoBuild: AzurePipeline
nodeVersion: 14.18.1
resources:
containers:
- container: mssql
Expand Down Expand Up @@ -194,12 +195,13 @@ stages:
# command: build
# projects: '**/Umbraco.Web.UI.csproj'
- task: NodeTool@0
displayName: Use Node 11.x
displayName: Use Node $(nodeVersion)
inputs:
versionSpec: 11.x
versionSpec: $(nodeVersion)
- task: Npm@1
displayName: npm install (Client)
displayName: npm ci (Client)
inputs:
command: ci
workingDir: src\Umbraco.Web.UI.Client
verbose: false
- task: gulp@0
Expand All @@ -220,8 +222,9 @@ stages:
@{ username = $env:Umbraco__CMS__Unattended__UnattendedUserEmail; password = $env:Umbraco__CMS__Unattended__UnattendedUserPassword } | ConvertTo-Json | Set-Content -Path "tests\Umbraco.Tests.AcceptanceTest\cypress.env.json"
- task: Npm@1
name: PrepareTask
displayName: npm install (AcceptanceTest)
displayName: npm ci (AcceptanceTest)
inputs:
command: ci
workingDir: 'tests\Umbraco.Tests.AcceptanceTest'
- task: Npm@1
displayName: Run Cypress (Desktop)
Expand Down Expand Up @@ -287,12 +290,13 @@ stages:
DBNAME: $(UmbracoDatabaseName)
SA_PASSWORD: $(SA_PASSWORD)
- task: NodeTool@0
displayName: Use Node 11.x
displayName: Use Node $(nodeVersion)
inputs:
versionSpec: 11.x
versionSpec: $(nodeVersion)
- task: Npm@1
displayName: npm install (Client)
displayName: npm ci (Client)
inputs:
command: ci
workingDir: src/Umbraco.Web.UI.Client
verbose: false
- task: gulp@0
Expand All @@ -301,11 +305,16 @@ stages:
gulpFile: src/Umbraco.Web.UI.Client/gulpfile.js
targets: build
workingDirectory: src/Umbraco.Web.UI.Client
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: build
projects: src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
- task: Bash@3
displayName: dotnet run
inputs:
targetType: 'inline'
script: 'nohup dotnet run -p ./src/Umbraco.Web.UI/Umbraco.Web.UI.csproj &'
script: 'nohup dotnet run --no-build -p ./src/Umbraco.Web.UI/ > $(Build.ArtifactStagingDirectory)/dotnet_run_log_linux.txt &'
- task: Bash@3
displayName: Generate Cypress.env.json
inputs:
Expand All @@ -316,8 +325,9 @@ stages:
PASSWORD: $(Umbraco__CMS__Unattended__UnattendedUserPassword)
- task: Npm@1
name: PrepareTask
displayName: npm install (AcceptanceTest)
displayName: npm ci (AcceptanceTest)
inputs:
command: ci
workingDir: 'tests/Umbraco.Tests.AcceptanceTest'
- task: Npm@1
displayName: Run Cypress (Desktop)
Expand All @@ -327,7 +337,6 @@ stages:
workingDir: tests/Umbraco.Tests.AcceptanceTest
command: 'custom'
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"'

- task: PublishTestResults@2
condition: always()
inputs:
Expand Down Expand Up @@ -356,6 +365,12 @@ stages:
inputs:
targetPath: '$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/cypress/artifacts'
artifact: 'Test artifacts - Linux'
- task: PublishPipelineArtifact@1
displayName: "Publish run log"
condition: failed()
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/dotnet_run_log_linux.txt'
artifact: Test Run logs - Linux
- stage: Artifacts
dependsOn: []
jobs:
Expand Down Expand Up @@ -443,12 +458,13 @@ stages:
$ubuild.CompileJsonSchema()
- task: NodeTool@0
displayName: Use Node 11.x
displayName: Use Node $(nodeVersion)
inputs:
versionSpec: 11.x
versionSpec: $(nodeVersion)
- task: Npm@1
displayName: npm install
displayName: npm ci (Client)
inputs:
command: ci
workingDir: src\Umbraco.Web.UI.Client
verbose: false
- task: gulp@0
Expand Down
8 changes: 4 additions & 4 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@
npm cache clean --force >> $log 2>&1
$error.Clear() # that one can fail 'cos security bug - ignore

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

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

"Generating the docs and waiting before executing the next commands"
& npm install
& npm ci
& npx gulp docs

Pop-Location
Expand Down
8 changes: 6 additions & 2 deletions src/Umbraco.Web.UI.Client/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ const { watchTask } = require('./gulp/tasks/watchTask');
// set default current compile mode:
config.compile.current = config.compile.build;

const coreBuild = parallel(dependencies, js, less, views);

// ***********************************************************
// These Exports are the new way of defining Tasks in Gulp 4.x
// ***********************************************************
exports.build = series(parallel(dependencies, js, less, views), testUnit);
exports.dev = series(setDevelopmentMode, parallel(dependencies, js, less, views), runUnitTestServer, watchTask);

exports.build = series(coreBuild, testUnit);
exports.coreBuild = coreBuild;
exports.dev = series(setDevelopmentMode, coreBuild, runUnitTestServer, watchTask);
exports.watch = series(watchTask);
//
exports.runTests = series(setTestMode, series(js, testUnit));
Expand Down
Loading

0 comments on commit 69f8e54

Please sign in to comment.