forked from openresty/docker-openresty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
129 lines (113 loc) · 5.45 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
# docker-openresty .travis.yml
#
# Builds docker-openresty images on Travis CI
#
# https://travis-ci.com/neomantra/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: bionic
language: ruby
services:
- docker
stages:
- build
- manifest
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 aarch64 Docker image for build-from-source flavors alpine and alpine-fat
stage: build
arch: arm64
script:
- ./docker_build_and_push_flavor.sh alpine-aarch64 alpine/Dockerfile
- ./docker_build_and_push_flavor.sh alpine-fat-aarch64 alpine/Dockerfile.fat
- name: Build amd64 Docker image for build-from-source flavors alpine and alpine-fat
stage: build
arch: amd64
script:
- ./docker_build_and_push_flavor.sh alpine-amd64 alpine/Dockerfile
- ./docker_build_and_push_flavor.sh alpine-fat-amd64 alpine/Dockerfile.fat
- name: Build aarch64 Docker image for build-from-source flavor bionic
arch: arm64
stage: build
script:
- ./docker_build_and_push_flavor.sh bionic-aarch64 bionic/Dockerfile
- name: Build amd64 Docker image for build-from-source flavor bionic
arch: amd64
stage: build
script:
- ./docker_build_and_push_flavor.sh bionic-amd64 bionic/Dockerfile
- name: Build aarch64 Docker image for build-from-source flavor focal
arch: arm64
stage: build
script:
- ./docker_build_and_push_flavor.sh focal-aarch64 focal/Dockerfile
- name: Build amd64 Docker image for build-from-source flavor focal
arch: amd64
stage: build
script:
- ./docker_build_and_push_flavor.sh focal-amd64 focal/Dockerfile
###############################################################################
# Build From OpenResty Upstream Flavors
# These are shorter to build are put in the same job (per architecture)
###############################################################################
- name: Build aarch64 Docker image for upstream flavors
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 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
- name: Build amd64 Docker image for upstream flavors
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 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 buster buster/Dockerfile
- ./docker_build_and_push_flavor.sh buster-fat buster/Dockerfile.fat
###############################################################################
# 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 alpine-fat alpine-fat-amd64 alpine-fat-aarch64
- ./docker_manifest.sh amzn2 amzn2-amd64 amzn2-aarch64
- ./docker_manifest.sh bionic bionic-amd64 bionic-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
- ./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:buster &&
docker tag $DOCKER_ORG/openresty:buster $DOCKER_ORG/openresty:latest &&
docker push $DOCKER_ORG/openresty:latest ;
fi