Skip to content

Commit

Permalink
feat(pipeline): Azure pipeline for Core and admin split
Browse files Browse the repository at this point in the history
  • Loading branch information
bkapustik committed Apr 16, 2024
1 parent e94d13d commit 7cc4fe2
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 66 deletions.
110 changes: 44 additions & 66 deletions .azuredevops/pipelines/build-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,73 +47,51 @@ stages:
- name: Configuration
value: Release

- name: ProjectFolder
value: src/Kentico.Xperience.Lucene

- name: ProjectFilePath
value: src/Kentico.Xperience.Lucene/Kentico.Xperience.Lucene.csproj
- name: slnPath
value: src/Kentico.Xperience.Lucene.Libs.sln

steps:
- task: PowerShell@2
displayName: Set Node.js version from package.json
inputs:
targetType: inline
script: |
$fileContent = Get-Content -Path './${{ variables.ProjectFolder }}/Admin/Client/package.json' -Raw
$jsonObject = ConvertFrom-Json -InputObject $fileContent
# Get the value of engines.node
$enginesNode = $jsonObject.engines.node
Write-Host "Required Node version $enginesNode"
Write-Host "##vso[task.setvariable variable=PACKAGE_JSON_NODE_VERSION]$enginesNode"
- task: UseNode@1
displayName: "Install Node.js from package.json version"
inputs:
version: $(PACKAGE_JSON_NODE_VERSION)

- task: DotNetCoreCLI@2
displayName: Restore dotnet tools
inputs:
command: custom
custom: tool
arguments: restore
workingDirectory: $(System.DefaultWorkingDirectory)

- task: DotNetCoreCLI@2
displayName: Restore dependencies
inputs:
command: restore
projects: ${{ variables.ProjectFilePath }}
feedsToUse: select
restoreArguments: --locked-mode

- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: ${{ variables.ProjectFilePath }}
configuration: ${{ variables.Configuration }}
arguments: --no-restore
env:
AuthenticodeClientSecret: $(AuthenticodeClientSecret)
# Roll-forward behavior set for AzureSignTool dotnet tool (see .config\dotnet-tools.json) which requires .Net 6.0 runtime
DOTNET_ROLL_FORWARD: Major

- task: DotNetCoreCLI@2
displayName: Create NuGet package
inputs:
command: pack
packagesToPack: ${{ variables.ProjectFilePath }}
configuration: ${{ variables.Configuration }}
packDirectory: $(System.DefaultWorkingDirectory)/packages
includesymbols: true
nobuild: true
versioningScheme: off

- publish: $(System.DefaultWorkingDirectory)/packages
displayName: Publish NuGet package as artifact
artifact: artifact
- task: DotNetCoreCLI@2
displayName: Restore dotnet tools
inputs:
command: custom
custom: tool
arguments: restore
workingDirectory: $(System.DefaultWorkingDirectory)

- task: DotNetCoreCLI@2
displayName: Restore dependencies
inputs:
command: restore
projects: ${{ variables.slnPath }}
feedsToUse: select
restoreArguments: --locked-mode

- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: ${{ variables.slnPath }}
configuration: ${{ variables.Configuration }}
arguments: --no-restore
env:
AuthenticodeClientSecret: $(AuthenticodeClientSecret)
# Roll-forward behavior set for AzureSignTool dotnet tool (see .config\dotnet-tools.json) which requires .Net 6.0 runtime
DOTNET_ROLL_FORWARD: Major

- template: steps.yml
parameters:
Configuration: $(Configuration)
artifacts:
- CRMCommon:
artifactName: "Kentico-Xperience-Lucene"
projectPath: "src/Kentico.Xperience.Lucene"
- CRMDynamics:
artifactName: "Kentico-Xperience-Lucene-Admin"
projectPath: "src/Kentico.Xperience.Lucene.Admin"
- CRMSalesforce:
artifactName: "Kentico-Xperience-Lucene-Core"
projectPath: "src/Kentico.Xperience.Lucene.Core"

- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
- stage: PublishNuGetPackages
Expand Down Expand Up @@ -153,7 +131,7 @@ stages:
displayName: NuGet push
inputs:
command: push
packagesToPush: $(Pipeline.Workspace)/artifact/*.nupkg
packagesToPush: $(Pipeline.Workspace)/**/*.nupkg
nuGetFeedType: external
publishFeedCredentials: nuget.org
allowPackageConflicts: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34701.34
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kentico.Xperience.Lucene", "..\Kentico.Xperience.Lucene\Kentico.Xperience.Lucene.csproj", "{A1502472-968B-4976-B732-71A0CC2ED5B9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kentico.Xperience.Lucene.Admin", "..\Kentico.Xperience.Lucene.Admin\Kentico.Xperience.Lucene.Admin.csproj", "{139F9BC9-4851-43EC-A8D4-4EB54C36E560}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kentico.Xperience.Lucene.Core", "..\Kentico.Xperience.Lucene.Core\Kentico.Xperience.Lucene.Core.csproj", "{3A9A6C3A-2980-4179-8CF6-E088AE3CD290}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A1502472-968B-4976-B732-71A0CC2ED5B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1502472-968B-4976-B732-71A0CC2ED5B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1502472-968B-4976-B732-71A0CC2ED5B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1502472-968B-4976-B732-71A0CC2ED5B9}.Release|Any CPU.Build.0 = Release|Any CPU
{139F9BC9-4851-43EC-A8D4-4EB54C36E560}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{139F9BC9-4851-43EC-A8D4-4EB54C36E560}.Debug|Any CPU.Build.0 = Debug|Any CPU
{139F9BC9-4851-43EC-A8D4-4EB54C36E560}.Release|Any CPU.ActiveCfg = Release|Any CPU
{139F9BC9-4851-43EC-A8D4-4EB54C36E560}.Release|Any CPU.Build.0 = Release|Any CPU
{3A9A6C3A-2980-4179-8CF6-E088AE3CD290}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A9A6C3A-2980-4179-8CF6-E088AE3CD290}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A9A6C3A-2980-4179-8CF6-E088AE3CD290}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3A9A6C3A-2980-4179-8CF6-E088AE3CD290}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A1E39334-8F1C-496F-8793-18426447ADF9}
EndGlobalSection
EndGlobal

0 comments on commit 7cc4fe2

Please sign in to comment.