forked from openresty/docker-openresty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis.yml.etlua
48 lines (44 loc) · 1.71 KB
/
travis.yml.etlua
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
# 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:
<% for i, flavor in pairs(flavors) do %>
- stage: build docker image for flavor <%= flavor %>
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -t openresty:<%= flavor -%> -f <%= flavor -%>/Dockerfile .
- if [[ "$TRAVIS_BRANCH" == "master" ]] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:<%= flavor -%> $DOCKER_ORG/openresty:<%= flavor -%> &&
docker push $DOCKER_ORG/openresty:<%= flavor -%> ;
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:<%= flavor -%> $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-<%= flavor -%> &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG_BASE-<%= flavor -%> ;
fi ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag openresty:<%= flavor -%> $DOCKER_ORG/openresty:$TRAVIS_TAG-<%= flavor -%> &&
docker push $DOCKER_ORG/openresty:$TRAVIS_TAG-<%= flavor -%> ;
fi
<% end %>