Skip to content

Commit 82943a0

Browse files
committed
Add initial ".azure.yml"
1 parent 4baab39 commit 82943a0

File tree

3 files changed

+151
-13
lines changed

3 files changed

+151
-13
lines changed

.azure.yml

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
strategy:
2+
matrix:
3+
3.8-rc-stretch:
4+
azureImage: 'ubuntu-16.04'
5+
buildContext: '3.8-rc/stretch'
6+
3.8-rc-stretch-slim:
7+
azureImage: 'ubuntu-16.04'
8+
buildContext: '3.8-rc/stretch/slim'
9+
3.8-rc-alpine3.9:
10+
azureImage: 'ubuntu-16.04'
11+
buildContext: '3.8-rc/alpine3.9'
12+
3.8-rc-windows-windowsservercore-1803:
13+
azureImage: 'win1803'
14+
buildContext: '3.8-rc/windows/windowsservercore-1803'
15+
3.7-stretch:
16+
azureImage: 'ubuntu-16.04'
17+
buildContext: '3.7/stretch'
18+
3.7-stretch-slim:
19+
azureImage: 'ubuntu-16.04'
20+
buildContext: '3.7/stretch/slim'
21+
3.7-alpine3.9:
22+
azureImage: 'ubuntu-16.04'
23+
buildContext: '3.7/alpine3.9'
24+
3.7-alpine3.8:
25+
azureImage: 'ubuntu-16.04'
26+
buildContext: '3.7/alpine3.8'
27+
3.7-windows-windowsservercore-1803:
28+
azureImage: 'win1803'
29+
buildContext: '3.7/windows/windowsservercore-1803'
30+
3.6-stretch:
31+
azureImage: 'ubuntu-16.04'
32+
buildContext: '3.6/stretch'
33+
3.6-stretch-slim:
34+
azureImage: 'ubuntu-16.04'
35+
buildContext: '3.6/stretch/slim'
36+
3.6-jessie:
37+
azureImage: 'ubuntu-16.04'
38+
buildContext: '3.6/jessie'
39+
3.6-jessie-slim:
40+
azureImage: 'ubuntu-16.04'
41+
buildContext: '3.6/jessie/slim'
42+
3.6-alpine3.9:
43+
azureImage: 'ubuntu-16.04'
44+
buildContext: '3.6/alpine3.9'
45+
3.6-alpine3.8:
46+
azureImage: 'ubuntu-16.04'
47+
buildContext: '3.6/alpine3.8'
48+
3.6-windows-windowsservercore-1803:
49+
azureImage: 'win1803'
50+
buildContext: '3.6/windows/windowsservercore-1803'
51+
3.5-stretch:
52+
azureImage: 'ubuntu-16.04'
53+
buildContext: '3.5/stretch'
54+
3.5-stretch-slim:
55+
azureImage: 'ubuntu-16.04'
56+
buildContext: '3.5/stretch/slim'
57+
3.5-jessie:
58+
azureImage: 'ubuntu-16.04'
59+
buildContext: '3.5/jessie'
60+
3.5-jessie-slim:
61+
azureImage: 'ubuntu-16.04'
62+
buildContext: '3.5/jessie/slim'
63+
3.5-alpine3.9:
64+
azureImage: 'ubuntu-16.04'
65+
buildContext: '3.5/alpine3.9'
66+
3.5-alpine3.8:
67+
azureImage: 'ubuntu-16.04'
68+
buildContext: '3.5/alpine3.8'
69+
2.7-stretch:
70+
azureImage: 'ubuntu-16.04'
71+
buildContext: '2.7/stretch'
72+
2.7-stretch-slim:
73+
azureImage: 'ubuntu-16.04'
74+
buildContext: '2.7/stretch/slim'
75+
2.7-jessie:
76+
azureImage: 'ubuntu-16.04'
77+
buildContext: '2.7/jessie'
78+
2.7-jessie-slim:
79+
azureImage: 'ubuntu-16.04'
80+
buildContext: '2.7/jessie/slim'
81+
2.7-alpine3.9:
82+
azureImage: 'ubuntu-16.04'
83+
buildContext: '2.7/alpine3.9'
84+
2.7-alpine3.8:
85+
azureImage: 'ubuntu-16.04'
86+
buildContext: '2.7/alpine3.8'
87+
2.7-windows-windowsservercore-1803:
88+
azureImage: 'win1803'
89+
buildContext: '2.7/windows/windowsservercore-1803'
90+
91+
pool:
92+
vmImage: $(azureImage)
93+
94+
steps:
95+
- bash: |
96+
set -Eeuo pipefail -x
97+
#git clone --depth 1 https://github.com/docker-library/official-images.git ~/oi
98+
git clone --depth 1 https://github.com/tianon/stackbrew.git -b azure ~/oi
99+
~/oi/.azure/wait-for-docker.sh
100+
~/oi/.azure/set-docker-tag.sh
101+
displayName: 'Prepare environment'
102+
103+
- bash: |
104+
set -Eeuo pipefail -x
105+
source <(wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh')
106+
displayName: 'Apply pgp-happy-eyeballs'
107+
condition: eq( variables['Agent.OS'], 'Linux' )
108+
109+
- bash: |
110+
set -Eeuo pipefail -x
111+
docker build -t '$(dockerTag)' .
112+
workingDirectory: $(buildContext)
113+
displayName: '"docker build"'
114+
115+
- bash: |
116+
set -Eeuo pipefail -x
117+
docker run --rm '$(dockerTag)' python --version
118+
displayName: 'Basic smoke tests'
119+
120+
- bash: |
121+
set -Eeuo pipefail -x
122+
~/oi/test/run.sh '$(dockerTag)'
123+
displayName: 'Run tests'
124+
condition: eq( variables['Agent.OS'], 'Linux' ) # TODO get tests running on Windows too
125+
126+
# vim:set tabstop=2 shiftwidth=2:

.travis.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ services: docker
33

44
matrix:
55
include:
6-
- os: windows
7-
dist: 1803-containers
8-
env: VERSION=3.8-rc VARIANT=windows/windowsservercore-1803
96
- os: linux
107
env: VERSION=3.8-rc VARIANT=stretch
118
- os: linux
@@ -14,7 +11,7 @@ matrix:
1411
env: VERSION=3.8-rc VARIANT=alpine3.9
1512
- os: windows
1613
dist: 1803-containers
17-
env: VERSION=3.7 VARIANT=windows/windowsservercore-1803
14+
env: VERSION=3.8-rc VARIANT=windows/windowsservercore-1803
1815
- os: linux
1916
env: VERSION=3.7 VARIANT=stretch
2017
- os: linux
@@ -25,7 +22,7 @@ matrix:
2522
env: VERSION=3.7 VARIANT=alpine3.8
2623
- os: windows
2724
dist: 1803-containers
28-
env: VERSION=3.6 VARIANT=windows/windowsservercore-1803
25+
env: VERSION=3.7 VARIANT=windows/windowsservercore-1803
2926
- os: linux
3027
env: VERSION=3.6 VARIANT=stretch
3128
- os: linux
@@ -38,6 +35,9 @@ matrix:
3835
env: VERSION=3.6 VARIANT=alpine3.9
3936
- os: linux
4037
env: VERSION=3.6 VARIANT=alpine3.8
38+
- os: windows
39+
dist: 1803-containers
40+
env: VERSION=3.6 VARIANT=windows/windowsservercore-1803
4141
- os: linux
4242
env: VERSION=3.5 VARIANT=stretch
4343
- os: linux
@@ -50,9 +50,6 @@ matrix:
5050
env: VERSION=3.5 VARIANT=alpine3.9
5151
- os: linux
5252
env: VERSION=3.5 VARIANT=alpine3.8
53-
- os: windows
54-
dist: 1803-containers
55-
env: VERSION=2.7 VARIANT=windows/windowsservercore-1803
5653
- os: linux
5754
env: VERSION=2.7 VARIANT=stretch
5855
- os: linux
@@ -65,6 +62,9 @@ matrix:
6562
env: VERSION=2.7 VARIANT=alpine3.9
6663
- os: linux
6764
env: VERSION=2.7 VARIANT=alpine3.8
65+
- os: windows
66+
dist: 1803-containers
67+
env: VERSION=2.7 VARIANT=windows/windowsservercore-1803
6868

6969
install:
7070
- git clone https://github.com/docker-library/official-images.git ~/official-images

update.sh

+17-5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ generated_warning() {
4646
EOH
4747
}
4848

49+
azureEnv=
4950
travisEnv=
5051
appveyorEnv=
5152
for version in "${versions[@]}"; do
@@ -113,9 +114,9 @@ for version in "${versions[@]}"; do
113114
echo "$version: $fullVersion"
114115

115116
for v in \
117+
windows/windowsservercore-{1809,1803,ltsc2016} \
116118
alpine{3.8,3.9} \
117119
{jessie,stretch}{/slim,} \
118-
windows/windowsservercore-{1809,1803,ltsc2016} \
119120
; do
120121
dir="$version/$v"
121122
variant="$(basename "$v")"
@@ -182,8 +183,10 @@ for version in "${versions[@]}"; do
182183
;;
183184
esac
184185

186+
azureImage=
185187
case "$v" in
186188
windows/*-1803)
189+
azureImage='win1803'
187190
travisEnv='\n - os: windows\n dist: 1803-containers\n env: VERSION='"$version VARIANT=$v$travisEnv"
188191
;;
189192

@@ -194,14 +197,23 @@ for version in "${versions[@]}"; do
194197
;;
195198

196199
*)
200+
azureImage='ubuntu-16.04'
197201
travisEnv='\n - os: linux\n env: VERSION='"$version VARIANT=$v$travisEnv"
198202
;;
199203
esac
204+
205+
if [ -n "$azureImage" ]; then
206+
azureTag="$(sed 's!/!-!g' <<<"$dir")"
207+
azureEnv="\n $azureTag:\n azureImage: '$azureImage'\n buildContext: '$dir'$azureEnv"
208+
fi
200209
done
201210
done
202211

203-
travis="$(awk -v 'RS=\n\n' '$1 == "matrix:" { $0 = "matrix:\n include:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"
204-
echo "$travis" > .travis.yml
212+
azure="$(awk -v 'RS=\n\n' -v azureEnv="$azureEnv" '$1 == "strategy:" { $0 = "strategy:\n matrix:" azureEnv } { printf "%s%s", $0, RS }' .azure.yml)"
213+
cat <<<"$azure" > .azure.yml
214+
215+
travis="$(awk -v 'RS=\n\n' -v travisEnv="$travisEnv" '$1 == "matrix:" { $0 = "matrix:\n include:" travisEnv } { printf "%s%s", $0, RS }' .travis.yml)"
216+
cat <<<"$travis" > .travis.yml
205217

206-
appveyor="$(awk -v 'RS=\n\n' '$1 == "environment:" { $0 = "environment:\n matrix:'"$appveyorEnv"'" } { printf "%s%s", $0, RS }' .appveyor.yml)"
207-
echo "$appveyor" > .appveyor.yml
218+
appveyor="$(awk -v 'RS=\n\n' -v appveyorEnv="$appveyorEnv" '$1 == "environment:" { $0 = "environment:\n matrix:" appveyorEnv } { printf "%s%s", $0, RS }' .appveyor.yml)"
219+
cat <<<"$appveyor" > .appveyor.yml

0 commit comments

Comments
 (0)