forked from ericyao2013/platform-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yaml
132 lines (129 loc) · 4.21 KB
/
azure-pipelines.yaml
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
name: "build-n-test"
trigger:
branches:
include:
- "master"
tags:
include:
- "*"
variables:
artifactDir: $(System.DefaultWorkingDirectory)/artifacts
jobs:
- job: "ubuntu_release"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
timeoutInMinutes: 0
pool:
vmImage: "ubuntu-18.04"
steps:
- checkout: self
clean: true
lfs: true
submodules: recursive
persistCredentials: true
- task: Docker@2
displayName: ubuntu
inputs:
command: buildAndPush
Dockerfile: docker/ubuntu
buildContext: "."
containerRegistry: airmapreg.acr
repository: platform-sdk.ubuntu
tags: |
$(Build.SourceVersion)
- bash: |
chmod +x ./docker/extract_artifacts.sh
./docker/extract_artifacts.sh airmapreg.azurecr.io/platform-sdk.ubuntu:"$(Build.SourceVersion)" "$(artifactDir)"
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(artifactDir)
artifactName: airmap-platform-sdk-releases
- job: "l4t_release"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
dependsOn: []
timeoutInMinutes: 0
pool:
vmImage: "ubuntu-20.04"
steps:
- checkout: self
clean: true
lfs: true
submodules: recursive
persistCredentials: true
- bash: |
chmod +x ./tools/l4t/build-docker-image.sh
./tools/l4t/build-docker-image.sh
chmod +x ./docker/extract_artifacts.sh
./docker/extract_artifacts.sh airmapreg.azurecr.io/platform-sdk.l4t:"$(Build.SourceVersion)" "$(artifactDir)"
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(artifactDir)
artifactName: airmap-platform-sdk-releases
- job: "github_release"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
pool:
vmImage: "ubuntu-20.04"
dependsOn:
- "l4t_release"
- "ubuntu_release"
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Gather Build Artifacts'
inputs:
artifact: 'airmap-platform-sdk-releases'
path: $(Build.ArtifactStagingDirectory)
- bash: |
set -eox pipefail
curl -fsSL https://github.com/cli/cli/releases/download/v1.9.2/gh_1.9.2_linux_amd64.tar.gz | tar -xzf - --no-anchored gh --strip-components 2
chmod a+x gh
./gh config set prompt disabled
# auth token supplied via ENV configured in pipeline variables setup
echo "$(GITHUB_TOKEN)" | ./gh auth login --with-token
# assume release version is most recent existing tag in repo
VERSION="$(git describe --abbrev=0 --tags)"
./gh release upload --repo=airmap/platform-sdk "$VERSION" "$(Build.ArtifactStagingDirectory)"/airmap-platform-sdk-*.deb
displayName: "Create GitHub release"
- job: "pr"
condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
timeoutInMinutes: 0
pool:
vmImage: "ubuntu-18.04"
steps:
- checkout: self
clean: true
lfs: true
submodules: recursive
persistCredentials: true
- bash: |
sudo apt-get install qemu binfmt-support qemu-user-static
docker run --platform=linux/amd64 --rm --privileged multiarch/qemu-user-static --reset -p yes
displayName: "Configure QEMU for L4T build"
- task: Docker@2
displayName: "L4T Build"
inputs:
command: build
Dockerfile: docker/l4t/l4t
buildContext: "."
containerRegistry: airmapreg.acr
repository: platform-sdk.l4t
tags: $(Build.sourceVersion)
- task: Docker@2
displayName: ubuntu
inputs:
command: build
Dockerfile: docker/ubuntu
buildContext: "."
containerRegistry: airmapreg.acr
repository: platform-sdk.ubuntu
tags: $(Build.SourceVersion)
- task: Docker@2
displayName: centos
inputs:
command: build
Dockerfile: docker/centos
buildContext: "."
- task: Docker@2
displayName: android
inputs:
command: build
Dockerfile: docker/android
buildContext: "."