-
Notifications
You must be signed in to change notification settings - Fork 11
/
azure-pipelines.yml
75 lines (70 loc) · 2.06 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
trigger:
batch: true
branches:
include:
- main
- stable-*
tags:
include:
- '*'
pr:
branches:
include:
- main
- stable-*
pool:
vmImage: 'ubuntu-22.04'
variables:
container_name: "quay.io/ansible/$(System.TeamProject)"
scratchpad_tag: "quay.io/ansible/scratchpad:$(System.TeamProject)-$(Build.SourceBranchName)-$(Build.BuildId)"
python_version: '3.10'
containmint_version: '0.2.0'
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
push_or_no_login: --push
${{ else }}:
push_or_no_login: --no-login
stages:
- stage: Build
dependsOn: []
jobs:
- job: Arch
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python_version)'
displayName: Use Python
- script: pip install containmint==$(containmint_version) --disable-pip-version-check --user
displayName: Install containmint
- script: >
containmint build
--tag "$(scratchpad_tag)-$(System.JobName)"
--arch "$(System.JobName)"
$(push_or_no_login)
displayName: Build
env:
CONTAINMINT_PASSWORD: $(CONTAINMINT_PASSWORD)
strategy:
matrix:
x86_64: {}
aarch64: {}
- stage: Deploy
dependsOn: Build
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
jobs:
- job: Image
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python_version)'
displayName: Use Python
- script: pip install containmint==$(containmint_version) --disable-pip-version-check --user
displayName: Install containmint
- script: >
containmint merge
--push
--tag "$(container_name):$(Build.SourceBranchName)"
"$(scratchpad_tag)-x86_64"
"$(scratchpad_tag)-aarch64"
displayName: Merge
env:
CONTAINMINT_PASSWORD: $(CONTAINMINT_PASSWORD)