Skip to content

Commit f9ca065

Browse files
arturcicArtur Stolear
authored andcommitted
(build) use cake tool + common steps
1 parent 224b61f commit f9ca065

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
stages:
2-
- stage: Pack
2+
- stage: Build
33
jobs:
4-
- job: Pack
4+
- job: Build
55
strategy:
66
matrix:
77
'Windows':
@@ -13,7 +13,7 @@ stages:
1313
pool:
1414
vmImage: $(VM_IMAGE)
1515
steps:
16-
- template: build/stages/pack.yml
16+
- template: build/stages/build.yml
1717

1818
- stage: Docker
1919
condition: succeeded()
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
steps:
2-
- task: DotNetCoreInstaller@0
3-
condition: eq( variables['Agent.OS'], 'Darwin' )
4-
displayName: 'Use .NET Core sdk 2.x'
5-
inputs:
6-
version: '2.2.107'
7-
packageType: sdk
2+
- template: common-steps.yml
83
- task: UseRubyVersion@0
94
condition: ne( variables['Agent.OS'], 'Darwin' )
105
displayName: 'Use .Ruby >= 2.5'
116
inputs:
127
versionSpec: '>= 2.5'
13-
addToPath: true # Optional
14-
- powershell: ./build.ps1 -script build.cake -target Pack
15-
displayName: 'Cake build and Package'
8+
addToPath: true
9+
- script: dotnet cake build.cake --bootstrap && dotnet cake build.cake --target=Copy-Files
10+
displayName: 'Cake build'
1611
env:
1712
GITHUB_TOKEN: $(GITHUB_TOKEN)
1813
NUGET_API_KEY: $(NUGET_API_KEY)
@@ -28,5 +23,6 @@ steps:
2823
ENABLED_PUBLISH_NUGET: $(ENABLED_PUBLISH_NUGET)
2924
ENABLED_PUBLISH_CHOCOLATEY: $(ENABLED_PUBLISH_CHOCOLATEY)
3025
- publish: $(System.DefaultWorkingDirectory)
26+
displayName: 'Upload pipeline artifacts'
3127
condition: eq( variables['Agent.OS'], 'Windows_NT' )
3228
artifact: artifacts

build/stages/common-steps.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
steps:
2+
- task: UseDotNet@2
3+
displayName: 'Use .NET Core sdk'
4+
inputs:
5+
packageType: sdk
6+
version: 2.2.107
7+
installationPath: $(Agent.ToolsDirectory)/dotnet
8+
- script: dotnet tool install --global Cake.Tool
9+
displayName: 'Install Cake tool'

build/stages/docker.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
steps:
2+
- template: common-steps.yml
23
- task: DownloadPipelineArtifact@2
4+
displayName: 'Download pipeline artifacts'
35
inputs:
46
source: current
57
path: $(Build.SourcesDirectory)
68
artifact: artifacts
7-
- powershell: ./build.ps1 -script build.cake -target Docker-Test
9+
- script: dotnet cake build.cake --bootstrap && dotnet cake build.cake --target=Copy-Files
810
displayName: 'Docker build'
911
env:
1012
DOCKER_USERNAME: $(DOCKER_USERNAME)

0 commit comments

Comments
 (0)