Skip to content

Commit 224b61f

Browse files
arturcicArtur Stolear
authored andcommitted
(build) multi-stage, added docker stage
1 parent 6b1c177 commit 224b61f

File tree

6 files changed

+78
-57
lines changed

6 files changed

+78
-57
lines changed

.artifactignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/*
2+
!artifacts
3+
!tools

azure-pipelines.yml

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
1-
jobs:
2-
- template: build/tmpl/jobs.yml
3-
parameters:
4-
name: macOS
5-
vmImage: 'macOS-latest'
1+
stages:
2+
- stage: Pack
3+
jobs:
4+
- job: Pack
5+
strategy:
6+
matrix:
7+
'Windows':
8+
VM_IMAGE: 'windows-2019'
9+
'Linux':
10+
VM_IMAGE: 'Ubuntu 16.04'
11+
'macOS':
12+
VM_IMAGE: 'macOS-latest'
13+
pool:
14+
vmImage: $(VM_IMAGE)
15+
steps:
16+
- template: build/stages/pack.yml
617

7-
- template: build/tmpl/jobs.yml
8-
parameters:
9-
name: Linux
10-
vmImage: 'Ubuntu 16.04'
11-
12-
- template: build/tmpl/jobs.yml
13-
parameters:
14-
name: Windows
15-
vmImage: 'windows-2019'
18+
- stage: Docker
19+
condition: succeeded()
20+
jobs:
21+
- job: Docker
22+
strategy:
23+
matrix:
24+
'Windows':
25+
VM_IMAGE: 'windows-2019'
26+
'Linux':
27+
VM_IMAGE: 'Ubuntu 16.04'
28+
pool:
29+
vmImage: $(VM_IMAGE)
30+
steps:
31+
- template: build/stages/docker.yml

build/pack.cake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Task("Test")
8383

8484
#endregion
8585

86-
#region Package
86+
#region Pack
8787

8888
Task("Copy-Files")
8989
.IsDependentOn("Test")

build/stages/docker.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
steps:
2+
- task: DownloadPipelineArtifact@2
3+
inputs:
4+
source: current
5+
path: $(Build.SourcesDirectory)
6+
artifact: artifacts
7+
- powershell: ./build.ps1 -script build.cake -target Docker-Test
8+
displayName: 'Docker build'
9+
env:
10+
DOCKER_USERNAME: $(DOCKER_USERNAME)
11+
DOCKER_PASSWORD: $(DOCKER_PASSWORD)
12+
ENABLED_PUBLISH_DOCKER: $(ENABLED_PUBLISH_DOCKER)

build/stages/pack.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
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
8+
- task: UseRubyVersion@0
9+
condition: ne( variables['Agent.OS'], 'Darwin' )
10+
displayName: 'Use .Ruby >= 2.5'
11+
inputs:
12+
versionSpec: '>= 2.5'
13+
addToPath: true # Optional
14+
- powershell: ./build.ps1 -script build.cake -target Pack
15+
displayName: 'Cake build and Package'
16+
env:
17+
GITHUB_TOKEN: $(GITHUB_TOKEN)
18+
NUGET_API_KEY: $(NUGET_API_KEY)
19+
NUGET_API_URL: $(NUGET_API_URL)
20+
CHOCOLATEY_API_KEY: $(CHOCOLATEY_API_KEY)
21+
CHOCOLATEY_API_URL: $(CHOCOLATEY_API_URL)
22+
RUBY_GEM_API_KEY: $(RUBY_GEM_API_KEY)
23+
TFX_TOKEN: $(TFX_TOKEN)
24+
CODECOV_TOKEN: $(CODECOV_TOKEN)
25+
ENABLED_UNIT_TESTS: $(ENABLED_UNIT_TESTS)
26+
ENABLED_PUBLISH_GEM: $(ENABLED_PUBLISH_GEM)
27+
ENABLED_PUBLISH_TFS: $(ENABLED_PUBLISH_TFS)
28+
ENABLED_PUBLISH_NUGET: $(ENABLED_PUBLISH_NUGET)
29+
ENABLED_PUBLISH_CHOCOLATEY: $(ENABLED_PUBLISH_CHOCOLATEY)
30+
- publish: $(System.DefaultWorkingDirectory)
31+
condition: eq( variables['Agent.OS'], 'Windows_NT' )
32+
artifact: artifacts

build/tmpl/jobs.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)