-
Notifications
You must be signed in to change notification settings - Fork 38
/
azure-pipelines.yml
70 lines (58 loc) · 2.02 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
# vim:ts=2:sts=2:sw=2:et
#
# Author: Hari Sekhon
# Date: Sun Feb 23 19:02:10 2020 +0000
#
# https://github.com/HariSekhon/Diagrams-as-Code
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback
# to help improve or steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# A z u r e D e v O p s P i p e l i n e
# ============================================================================ #
# https://aka.ms/yaml
trigger:
- master
variables:
# ubuntu version
os_version: '22.04'
pool:
# there is no /dev/stderr on this azure build!
#vmImage: 'ubuntu-latest'
#vmImage: 'ubuntu-22.04'
vmImage: 'ubuntu-$(os_version)'
# unprivileged container without sudo, cannot install dependencies
#container: ubuntu:22.04
steps:
- script: cat /etc/*-release
displayName: OS Release
# requires script as first key, otherwise parsing breaks with error message: Unexpected value 'displayName'
- script: env | sort
displayName: Environment
# doesn't work in container due to unprivileged execution and lack of sudo
#- script: sudo apt-get update && sudo apt-get install -y git make
# displayName: install git & make
#- script: make
# displayName: build
# doesn't work in vmImage build due to lack of access to normal /dev/stderr device
# tee: /dev/stderr: No such device or address
#- script: make test
# displayName: test
# hacky workaround to Azure Pipelines ubuntu environment limitations of unprivileged container and no /dev/stderr in vmImage :-(
- script: |
sudo docker run -v "$PWD":/code "ubuntu:$(os_version)" /bin/bash -c '
set -ex
cd /code
setup/ci_bootstrap.sh
if [ -x setup/ci_git_set_dir_safe.sh ]; then
setup/ci_git_set_dir_safe.sh
fi
make init
make ci test
'
displayName: docker build