forked from openresty/docker-openresty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
210 lines (184 loc) · 9.77 KB
/
.travis.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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# docker-openresty .travis.yml
#
# Builds docker-openresty images on Travis CI
#
# https://travis-ci.com/github/openresty/docker-openresty
#
#
# Master will build with Docker tag:
# openresty:<flavor>
#
# Releases should be tagged in git as:
# <openresty-version>-<docker-version>
#
# This will build with Docker tags:
# openresty:<openresty-version>-<docker-version>-<flavor>
# openresty:<openresty-version>-<flavor>
#
os: linux
dist: focal
language: generic
addons:
apt:
sources:
- sourceline: 'deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable'
key_url: 'https://download.docker.com/linux/ubuntu/gpg'
packages:
- docker-ce
- docker-ce-cli
services:
- docker
stages:
- build
- manifest
- build-fat
- manifest-fat
before_script:
- echo $DOCKER_PASSWORD > /tmp/docker.pass
jobs:
include:
###############################################################################
# Build From Source Flavors
# These take longer to build and are put in their own jobs
###############################################################################
- name: Build Docker image for build-from-source flavors -- alpine / aarch64
stage: build
arch: arm64
script:
- ./docker_build_and_push_flavor.sh alpine-aarch64 alpine/Dockerfile
- name: Build Docker image for build-from-source flavors -- alpine / amd64
stage: build
arch: amd64
script:
- ./docker_build_and_push_flavor.sh alpine-amd64 alpine/Dockerfile
- name: Build Docker image for build-from-source flavor -- bionic / aarch64
arch: arm64
stage: build
script:
- ./docker_build_and_push_flavor.sh bionic-aarch64 bionic/Dockerfile
- name: Build Docker image for build-from-source flavor -- bionic / amd64
arch: amd64
stage: build
script:
- ./docker_build_and_push_flavor.sh bionic-amd64 bionic/Dockerfile
- name: Build Docker image for build-from-source flavor -- bionic / s390x
arch: s390x
stage: build
script:
- ./docker_build_and_push_flavor.sh bionic-s390x bionic/Dockerfile --build-arg RESTY_PCRE_BUILD_OPTIONS="" --build-arg RESTY_PCRE_OPTIONS=""
- name: Build Docker image for build-from-source flavor -- focal / aarch64
arch: arm64
stage: build
script:
- ./docker_build_and_push_flavor.sh focal-aarch64 focal/Dockerfile
- name: Build Docker image for build-from-source flavor -- focal / amd64
arch: amd64
stage: build
script:
- ./docker_build_and_push_flavor.sh focal-amd64 focal/Dockerfile
- name: Build Docker image for build-from-source flavor -- focal / s390x
arch: s390x
stage: build
script:
- ./docker_build_and_push_flavor.sh focal-s390x focal/Dockerfile --build-arg RESTY_PCRE_BUILD_OPTIONS="" --build-arg RESTY_PCRE_OPTIONS=""
- name: Build Docker image for build-from-source flavor -- jammy / aarch64
arch: arm64
stage: build
script:
- ./docker_build_and_push_flavor.sh jammy-aarch64 jammy/Dockerfile
- name: Build Docker image for build-from-source flavor -- jammy / amd64
arch: amd64
stage: build
script:
- ./docker_build_and_push_flavor.sh jammy-amd64 jammy/Dockerfile
# jammy / s390x disabled due to build issues (#209)
# - name: Build Docker image for build-from-source flavor -- jammy / s390x
# arch: s390x
# stage: build
# script:
# - ./docker_build_and_push_flavor.sh jammy-s390x jammy/Dockerfile --build-arg RESTY_PCRE_BUILD_OPTIONS="" --build-arg RESTY_PCRE_OPTIONS=""
###############################################################################
# Build From OpenResty Upstream Flavors
# These are shorter to build are put in the same job (per architecture)
###############################################################################
- name: Build Docker image for upstream flavors -- aarch64
arch: arm64
stage: build
script:
- ./docker_build_and_push_flavor.sh alpine-apk-aarch64 alpine-apk/Dockerfile
- ./docker_build_and_push_flavor.sh amzn2-aarch64 centos/Dockerfile --build-arg RESTY_IMAGE_BASE=amazonlinux --build-arg RESTY_IMAGE_TAG=2 --build-arg RESTY_YUM_REPO="https://openresty.org/package/amazon/openresty.repo" --build-arg RESTY_RPM_DIST="amzn2" --build-arg RESTY_RPM_ARCH="aarch64"
- ./docker_build_and_push_flavor.sh rocky-aarch64 fedora/Dockerfile --build-arg RESTY_IMAGE_BASE=rockylinux --build-arg RESTY_IMAGE_TAG=8.5 --build-arg RESTY_YUM_REPO="https://openresty.org/package/rocky/openresty.repo" --build-arg RESTY_RPM_DIST="el8" --build-arg RESTY_RPM_ARCH="aarch64"
- ./docker_build_and_push_flavor.sh centos-aarch64 centos/Dockerfile --build-arg RESTY_RPM_ARCH=aarch64
- ./docker_build_and_push_flavor.sh centos7-aarch64 centos7/Dockerfile --build-arg RESTY_RPM_ARCH=aarch64
- ./docker_build_and_push_flavor.sh fedora-aarch64 fedora/Dockerfile --build-arg RESTY_RPM_ARCH=aarch64
- ./docker_build_and_push_flavor.sh bookworm-aarch64 bookworm/Dockerfile --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian" --build-arg RESTY_APT_ARCH="arm64"
- ./docker_build_and_push_flavor.sh bullseye-aarch64 bullseye/Dockerfile --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian"
- ./docker_build_and_push_flavor.sh buster-aarch64 buster/Dockerfile --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian"
- name: Build Docker image for upstream flavors -- amd64
arch: amd64
stage: build
script:
- ./docker_build_and_push_flavor.sh alpine-apk-amd64 alpine-apk/Dockerfile
- ./docker_build_and_push_flavor.sh amzn2-amd64 centos/Dockerfile --build-arg RESTY_IMAGE_BASE=amazonlinux --build-arg RESTY_IMAGE_TAG=2 --build-arg RESTY_YUM_REPO="https://openresty.org/package/amazon/openresty.repo" --build-arg RESTY_RPM_DIST="amzn2"
- ./docker_build_and_push_flavor.sh rocky-amd64 fedora/Dockerfile --build-arg RESTY_IMAGE_BASE=rockylinux --build-arg RESTY_IMAGE_TAG=8.5 --build-arg RESTY_YUM_REPO="https://openresty.org/package/rocky/openresty.repo" --build-arg RESTY_RPM_DIST="el8"
- ./docker_build_and_push_flavor.sh centos-amd64 centos/Dockerfile
- ./docker_build_and_push_flavor.sh centos7-amd64 centos7/Dockerfile
- ./docker_build_and_push_flavor.sh fedora-amd64 fedora/Dockerfile
- ./docker_build_and_push_flavor.sh bookworm-amd64 bookworm/Dockerfile
- ./docker_build_and_push_flavor.sh bullseye-amd64 bullseye/Dockerfile
- ./docker_build_and_push_flavor.sh buster-amd64 buster/Dockerfile
###############################################################################
# Multi-arch manifests
###############################################################################
# also master buster gets tagged "latest"
- name: Create and push manifests for multi-arch images
stage: manifest
script:
- ./docker_manifest.sh alpine alpine-amd64 alpine-aarch64
- ./docker_manifest.sh alpine-apk alpine-apk-amd64 alpine-apk-aarch64
- ./docker_manifest.sh amzn2 amzn2-amd64 amzn2-aarch64
- ./docker_manifest.sh bionic bionic-amd64 bionic-aarch64 bionic-s390x
- ./docker_manifest.sh bookworm bookworm-amd64 bookworm-aarch64
- ./docker_manifest.sh bullseye bullseye-amd64 bullseye-aarch64
- ./docker_manifest.sh buster buster-amd64 buster-aarch64
- ./docker_manifest.sh centos centos-amd64 centos-aarch64
- ./docker_manifest.sh centos7 centos7-amd64 centos7-aarch64
- ./docker_manifest.sh fedora fedora-amd64 # fedora-aarch64
- ./docker_manifest.sh focal focal-amd64 focal-aarch64 focal-s390x
- ./docker_manifest.sh jammy jammy-amd64 jammy-aarch64 #jammy-s309x
- ./docker_manifest.sh rocky rocky-amd64 rocky-aarch64
- ./docker_tag_alias.sh centos centos-rpm
- ./docker_tag_alias.sh fedora fedora-rpm
- if [[ "$TRAVIS_BRANCH" == "master" ]] ; then
echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin &&
docker pull $DOCKER_ORG/openresty:bullseye &&
docker tag $DOCKER_ORG/openresty:bullseye $DOCKER_ORG/openresty:latest &&
docker push $DOCKER_ORG/openresty:latest ;
fi
###############################################################################
# Build Derived ("fat") Flavors
# Built after other images
###############################################################################
- name: Build fat Docker image -- aarch64
stage: build-fat
arch: arm64
script:
- ./docker_build_and_push_flavor_fat.sh bookworm-fat-aarch64 bookworm/Dockerfile.fat
- ./docker_build_and_push_flavor_fat.sh bullseye-fat-aarch64 bullseye/Dockerfile.fat
- ./docker_build_and_push_flavor_fat.sh buster-fat-aarch64 buster/Dockerfile.fat
- ./docker_build_and_push_flavor_fat.sh alpine-fat-aarch64 alpine/Dockerfile.fat
- name: Build fat Docker image -- amd64
arch: amd64
stage: build-fat
script:
- ./docker_build_and_push_flavor_fat.sh bookworm-fat-amd64 bookworm/Dockerfile.fat
- ./docker_build_and_push_flavor_fat.sh bullseye-fat-amd64 bullseye/Dockerfile.fat
- ./docker_build_and_push_flavor_fat.sh buster-fat-amd64 buster/Dockerfile.fat
- ./docker_build_and_push_flavor_fat.sh alpine-fat-amd64 alpine/Dockerfile.fat
- name: Create and push manifests for fat multi-arch images
stage: manifest-fat
script:
- ./docker_manifest.sh bookworm-fat bookworm-fat-amd64 bookworm-fat-aarch64
- ./docker_manifest.sh bullseye-fat bullseye-fat-amd64 bullseye-fat-aarch64
- ./docker_manifest.sh buster-fat buster-fat-amd64 buster-fat-aarch64
- ./docker_manifest.sh alpine-fat alpine-fat-amd64 alpine-fat-aarch64