-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
91 lines (86 loc) · 4.48 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
# docker-flatbuffers .travis.yml
#
# Builds docker-flatbuffers images on Travis CI
#
# https://travis-ci.com/neomantra/docker-flatbuffers
#
#
# Master will build images with Docker tag:
# neomantra/flatbuffers (gcc)
# neomantra/flatbuffers:gcc
# neomantra/flatbuffers:clang
# neomantra/flatbuffers-YYYYMMDD (gcc)
# neomantra/flatbuffers:gcc-YYYYMMDD
# neomantra/flatbuffers:clang-YYYYMMDD
#
# Releases should be tagged in git as:
# neomantra/flatbuffers:<flatbuffers-version> (gcc)
# neomantra/flatbuffers:<flatbuffers-version>-<flaccc-version> (gcc)
# neomantra/flatbuffers:gcc-<flatbuffers-version>
# neomantra/flatbuffers:gcc-<flatbuffers-version>-<flaccc-version>
# neomantra/flatbuffers:clang-<flatbuffers-version>
# neomantra/flatbuffers:gcc-<flatbuffers-version>-<flaccc-version>
#
sudo: required
services:
- docker
jobs:
include:
- stage: build docker image for gcc flavor
script:
- if [[ "$TRAVIS_BRANCH" == "master" ]] ; then
docker build -t flatbuffers . ;
YYYYMMDD=$(date +%Y%m%d) ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag flatbuffers $DOCKER_ORG/flatbuffers:gcc &&
docker push $DOCKER_ORG/flatbuffers:gcc &&
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag flatbuffers $DOCKER_ORG/flatbuffers:gcc-$YYYYMMDD &&
docker push $DOCKER_ORG/flatbuffers:gcc-$YYYYMMDD &&
docker tag flatbuffers $DOCKER_ORG/flatbuffers &&
docker push $DOCKER_ORG/flatbuffers &&
docker tag flatbuffers $DOCKER_ORG/flatbuffers:$YYYYMMDD &&
docker push $DOCKER_ORG/flatbuffers:$YYYYMMDD ;
fi
- if [[ "$TRAVIS_TAG" ]] ; then
FLATC_VER=$( echo "$TRAVIS_TAG" | awk -F - '{print $1}') ;
FLATCC_VER=$(echo "$TRAVIS_TAG" | awk -F - '{print $2}' | sed 's/cc/v/') ;
FLATCC_TAG=$(echo "$TRAVIS_TAG" | awk -F - '{print $2}') ;
docker build -t flatbuffers-tag --build-arg FLATBUFFERS_ARCHIVE_TAG=$FLATC_VER --build-arg FLATCC_ARCHIVE_TAG=$FLATCC_VER . ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag flatbuffers-tag $DOCKER_ORG/flatbuffers:gcc-$FLATC_VER &&
docker push $DOCKER_ORG/flatbuffers:gcc-$FLATC_VER ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag flatbuffers-tag $DOCKER_ORG/flatbuffers:$FLATC_VER &&
docker push $DOCKER_ORG/flatbuffers:$FLATC_VER ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag flatbuffers-tag $DOCKER_ORG/flatbuffers:gcc-$FLATC_VER-$FLATCC_TAG &&
docker push $DOCKER_ORG/flatbuffers:gcc-$FLATC_VER-$FLATCC_TAG ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag flatbuffers-tag $DOCKER_ORG/flatbuffers:$FLATC_VER-$FLATCC_TAG &&
docker push $DOCKER_ORG/flatbuffers:$FLATC_VER-$FLATCC_TAG ;
fi
- stage: build docker image for clang flavor
script:
- if [[ "$TRAVIS_BRANCH" == "master" ]] ; then
docker build -t flatbuffers-clang --build-arg FLATBUFFERS_USE_CLANG="true" . ;
YYYYMMDD=$(date +%Y%m%d) ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag flatbuffers-clang $DOCKER_ORG/flatbuffers:clang &&
docker push $DOCKER_ORG/flatbuffers:clang &&
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag flatbuffers-clang $DOCKER_ORG/flatbuffers:clang-$YYYYMMDD &&
docker push $DOCKER_ORG/flatbuffers:clang-$YYYYMMDD ;
fi
- if [[ "$TRAVIS_TAG" ]] ; then
FLATC_VER=$( echo "$TRAVIS_TAG" | awk -F - '{print $1}') ;
FLATCC_VER=$(echo "$TRAVIS_TAG" | awk -F - '{print $2}' | sed 's/cc/v/') ;
FLATCC_TAG=$(echo "$TRAVIS_TAG" | awk -F - '{print $2}') ;
docker build -t flatbuffers-clang-tag --build-arg FLATBUFFERS_USE_CLANG="true" --build-arg FLATBUFFERS_ARCHIVE_TAG=$FLATC_VER --build-arg FLATCC_ARCHIVE_TAG=$FLATCC_VER . ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag flatbuffers-clang-tag $DOCKER_ORG/flatbuffers:clang-$FLATC_VER &&
docker push $DOCKER_ORG/flatbuffers:clang-$FLATC_VER ;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker tag flatbuffers-clang-tag $DOCKER_ORG/flatbuffers:clang-$FLATC_VER-$FLATCC_TAG &&
docker push $DOCKER_ORG/flatbuffers:clang-$FLATC_VER-$FLATCC_TAG ;
fi