-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathazure-pipelines.yml
62 lines (59 loc) · 1.85 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
trigger:
branches:
include:
- main
pr:
branches:
include:
- main
variables:
- group: kuiper2.0_group_variables
- ${{ if eq(variables['Build.Reason'], 'PullRequest')}}:
- name: branch
value: $[replace(variables['System.PullRequest.TargetBranch'], 'refs/heads/', '')]
- ${{ else }}:
- name: branch
value: $[replace(variables['Build.SourceBranch'], 'refs/heads/', '')]
jobs:
- job: Kuiper
strategy:
matrix:
${{if true }}:
'32bit basic':
group_var: 'KUIPER_BASIC_32'
artifact_name: 'kuiper_volume_basic_32'
'64bit basic':
group_var: 'KUIPER_BASIC_64'
artifact_name: 'kuiper_volume_basic_64'
${{ if ne(variables['Build.Reason'], 'PullRequest')}}:
'32bit full':
group_var: 'KUIPER_FULL_32'
artifact_name: 'kuiper_volume_full_32'
'64bit full':
group_var: 'KUIPER_FULL_64'
artifact_name: 'kuiper_volume_full_64'
pool:
vmImage: ubuntu-latest
timeoutInMinutes: 200
steps:
- checkout: self
fetchDepth: 1
submodules: true
clean: true
persistCredentials: true
- script: |
sudo apt-get install -y qemu-user-static
branch_name=$(echo $(branch) | tr 'a-z' 'A-Z' | sed 's/[^[:alnum:]]/_/g')
# var_name stores the name of a variabile which is defined in the group variable
# is accessed by indirect expansion of the environment variable which is exported from the group
var_name="$(group_var)_$branch_name"
ci/modify_config.sh ./config "${!var_name}"
sudo bash build-docker.sh
ls kuiper-volume/*.zip >/dev/null 2>&1 && exit 0 || exit 2
displayName: 'Build image'
- task: PublishPipelineArtifact@1
condition: true
inputs:
targetPath: '$(Build.Repository.LocalPath)/kuiper-volume'
artifact: $(artifact_name)
publishLocation: 'pipeline'