-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
133 lines (128 loc) · 4.4 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
variables:
PERLBREW_ROOT: "$(Pipeline.Workspace)/perl5/perlbrew"
DOCKER_BUILDKIT: 1
trigger:
branches:
exclude:
- no-ci-*
tags:
include:
- v*
paths:
exclude:
- .gitignore
- .test-vars-ignore
- Changes.md
- cron/
- dev/
- git/
- perlcriticrc
- perltidyrc
- precious.toml
- README.md
stages:
- stage: TestDeploymentCode
displayName: Run tests for the deployment code
jobs:
- job: RunTests
displayName: Run the tests
pool:
vmImage: ubuntu-20.04
steps:
- template: templates/deploy/install-perl.yml
parameters:
perlbrew_root: $(PERLBREW_ROOT)
with_test_prereqs: true
- bash: |
set -e
set -x
$(PERLBREW_ROOT)/bin/perlbrew exec --with 5.30.2 prove -lr -j 12 t
displayName: Run tests with prove
- stage: DeployToolsPerlImage
displayName: Deploy the tools-perl base image
dependsOn: TestDeploymentCode
jobs:
- job: BuildToolsPerlImage
displayName: Deploy the tools-perl base image
pool:
vmImage: ubuntu-20.04
steps:
- template: templates/deploy/install-perl.yml
parameters:
perlbrew_root: $(PERLBREW_ROOT)
with_test_prereqs: false
- bash: |
set -eo pipefail
set -x
$(PERLBREW_ROOT)/bin/perlbrew exec --with 5.30.2 perl ./deploy/bin/write-tools-perl-dockerfile.pl
name: WriteToolsPerlDockerfile
displayName: Write tools-perl dockerfile
- task: Docker@2
displayName: Log in to GitHub Container Registry
inputs:
command: login
containerRegistry: GitHub Container Registry
- task: Docker@2
displayName: Build and push tools-perl image
inputs:
command: buildAndPush
containerRegistry: GitHub Container Registry
repository: houseabsolute/ci-perl-helpers-ubuntu
tags: |
$(WriteToolsPerlDockerfile.base_image_tag0)
$(WriteToolsPerlDockerfile.base_image_tag1)
- stage: DeployRuntimePerlImages
displayName: Deploy the runtime-perl images
dependsOn: DeployToolsPerlImage
jobs:
- job: GenerateMatrix
displayName: Generate the matrix of Perl versions to build
pool:
vmImage: ubuntu-20.04
steps:
- template: templates/deploy/install-perl.yml
parameters:
perlbrew_root: $(PERLBREW_ROOT)
- bash: |
set -eo pipefail
set -x
$(PERLBREW_ROOT)/bin/perlbrew exec --with 5.30.2 perl ./deploy/bin/print-perls-matrix.pl | tee ./deploy-matrix
perls=$( cat ./deploy-matrix )
set +x
echo "##vso[task.setVariable variable=perls;isOutput=true]$perls"
name: matrixGenerator
displayName: Generate perl version matrix
- job: BuildOneImage
displayName: Deploy the runtime-perl images
pool:
vmImage: ubuntu-20.04
dependsOn: GenerateMatrix
strategy:
matrix: $[ dependencies.GenerateMatrix.outputs['matrixGenerator.perls'] ]
steps:
- template: templates/deploy/install-perl.yml
parameters:
perlbrew_root: $(PERLBREW_ROOT)
- bash: |
set -eo pipefail
set -x
threads="--no-threads"
if [ "$(threads)" == "true" ]; then
threads="--threads"
fi
$(PERLBREW_ROOT)/bin/perlbrew exec --with 5.30.2 perl ./deploy/bin/write-runtime-perl-dockerfile.pl \
--perl $(perl) \
$threads
displayName: Write runtime-perl dockerfile for perl=$(perl), threads=$(threads)
- task: Docker@2
displayName: Log in to Docker Hub
inputs:
command: login
containerRegistry: GitHub Container Registry
- task: Docker@2
displayName: Build and push runtime-perl image for perl=$(perl), threads=$(threads)
inputs:
command: buildAndPush
containerRegistry: GitHub Container Registry
repository: houseabsolute/ci-perl-helpers-ubuntu
tags: $(tags)