forked from openresty/docker-openresty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
153 lines (145 loc) · 7.64 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
# docker-openresty .travis.yml
#
# Builds docker-openresty images on Travis CI
#
# https://travis-ci.org/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>
#
sudo: required
services:
- docker
jobs:
include:
- stage: build docker image for flavors alpine and alpine-fat
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -t openresty:alpine -f alpine/Dockerfile .
- if [[ "$TRAVIS_BRANCH" == "master" ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:alpine $DOCKER_ORG/openresty:alpine &&
docker push $DOCKER_ORG/openresty:alpine ;
fi
- if [[ "$TRAVIS_TAG" ]] ; then
TRAVIS_TAG_BASE=$(echo -n "$TRAVIS_TAG" | sed 's/-[0-9]$//g') ;
if [[ ( "$TRAVIS_TAG_BASE" ) && ( "$TRAVIS_TAG_BASE" != "$TRAVIS_TAG" ) ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:alpine $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-alpine &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-alpine ;
fi ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:alpine $DOCKER_ORG/openresty:$TRAVIS_TAG-alpine &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG-alpine ;
fi
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -t openresty:alpine-fat -f alpine/Dockerfile.fat .
- if [[ "$TRAVIS_BRANCH" == "master" ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:alpine-fat $DOCKER_ORG/openresty:alpine-fat &&
docker push $DOCKER_ORG/openresty:alpine-fat ;
fi
- if [[ "$TRAVIS_TAG" ]] ; then
TRAVIS_TAG_BASE=$(echo -n "$TRAVIS_TAG" | sed 's/-[0-9]$//g') ;
if [[ ( "$TRAVIS_TAG_BASE" ) && ( "$TRAVIS_TAG_BASE" != "$TRAVIS_TAG" ) ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:alpine-fat $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-alpine-fat &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-alpine-fat ;
fi ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:alpine-fat $DOCKER_ORG/openresty:$TRAVIS_TAG-alpine-fat &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG-alpine-fat ;
fi
# aliased as `centos-rpm`
- stage: build docker image for flavor centos
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -t openresty:centos -f centos/Dockerfile .
- if [[ "$TRAVIS_BRANCH" == "master" ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:centos $DOCKER_ORG/openresty:centos &&
docker push $DOCKER_ORG/openresty:centos ;
docker tag $DOCKER_ORG/openresty:centos $DOCKER_ORG/openresty:centos-rpm &&
docker push $DOCKER_ORG/openresty:centos-rpm ;
fi
- if [[ "$TRAVIS_TAG" ]] ; then
TRAVIS_TAG_BASE=$(echo -n "$TRAVIS_TAG" | sed 's/-[0-9]$//g') ;
if [[ ( "$TRAVIS_TAG_BASE" ) && ( "$TRAVIS_TAG_BASE" != "$TRAVIS_TAG" ) ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:centos $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-centos &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-centos ;
docker tag $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-centos $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-centos-rpm &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-centos-rpm ;
fi ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:centos $DOCKER_ORG/openresty:$TRAVIS_TAG-centos &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG-centos ;
docker tag $DOCKER_ORG/openresty:$TRAVIS_TAG-centos $DOCKER_ORG/openresty:$TRAVIS_TAG-centos-rpm &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG-centos-rpm ;
fi
- stage: build docker image for flavor stretch and stretch-fat
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -t openresty:stretch -f stretch/Dockerfile .
- if [[ "$TRAVIS_BRANCH" == "master" ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:stretch $DOCKER_ORG/openresty:stretch &&
docker push $DOCKER_ORG/openresty:stretch ;
fi
- if [[ "$TRAVIS_TAG" ]] ; then
TRAVIS_TAG_BASE=$(echo -n "$TRAVIS_TAG" | sed 's/-[0-9]$//g') ;
if [[ ( "$TRAVIS_TAG_BASE" ) && ( "$TRAVIS_TAG_BASE" != "$TRAVIS_TAG" ) ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:stretch $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-stretch &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-stretch ;
fi ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:stretch $DOCKER_ORG/openresty:$TRAVIS_TAG-stretch &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG-stretch ;
fi
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -t openresty:stretch-fat -f stretch/Dockerfile.fat .
- if [[ "$TRAVIS_BRANCH" == "master" ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:stretch-fat $DOCKER_ORG/openresty:stretch-fat &&
docker push $DOCKER_ORG/openresty:stretch-fat ;
fi
- if [[ "$TRAVIS_TAG" ]] ; then
TRAVIS_TAG_BASE=$(echo -n "$TRAVIS_TAG" | sed 's/-[0-9]$//g') ;
if [[ ( "$TRAVIS_TAG_BASE" ) && ( "$TRAVIS_TAG_BASE" != "$TRAVIS_TAG" ) ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:stretch-fat $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-stretch-fat &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-stretch-fat ;
fi ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:stretch-fat $DOCKER_ORG/openresty:$TRAVIS_TAG-stretch-fat &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG-stretch-fat ;
fi
- stage: build docker image for flavor xenial
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -t openresty:xenial -f xenial/Dockerfile .
- if [[ "$TRAVIS_BRANCH" == "master" ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:xenial $DOCKER_ORG/openresty:xenial &&
docker push $DOCKER_ORG/openresty:xenial ;
fi
- if [[ "$TRAVIS_TAG" ]] ; then
TRAVIS_TAG_BASE=$(echo -n "$TRAVIS_TAG" | sed 's/-[0-9]$//g') ;
if [[ ( "$TRAVIS_TAG_BASE" ) && ( "$TRAVIS_TAG_BASE" != "$TRAVIS_TAG" ) ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:xenial $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-xenial &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-xenial ;
fi ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:xenial $DOCKER_ORG/openresty:$TRAVIS_TAG-xenial &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG-xenial ;
fi