-
Notifications
You must be signed in to change notification settings - Fork 24
/
.travis.yml
186 lines (170 loc) · 4.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
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
os: linux
dist: xenial
language: php
# Disable tarantool-1.6 and 1.7 on php 7.1-7.4, because
# php-7.[1-4]-cli docker images are based on Debian Buster, but we
# have no tarantool-1.[6-7] packages for this distribution.
jobs:
include:
# PHP 7.0
# -------
- php: 7.0
env: TARANTOOL_VERSION=1.6
- php: 7.0
env: TARANTOOL_VERSION=1.7
- php: 7.0
env: TARANTOOL_VERSION=1.9
- php: 7.0
env: TARANTOOL_VERSION=1.10
- php: 7.0
env: TARANTOOL_VERSION=2.1
- php: 7.0
env: TARANTOOL_VERSION=2.2
- php: 7.0
env: TARANTOOL_VERSION=2.3
- php: 7.0
env: TARANTOOL_VERSION=2.4
- php: 7.0
env: TARANTOOL_VERSION=2.5
# PHP 7.1
# -------
- php: 7.1
env: TARANTOOL_VERSION=1.9
- php: 7.1
env: TARANTOOL_VERSION=1.10
- php: 7.1
env: TARANTOOL_VERSION=2.1
- php: 7.1
env: TARANTOOL_VERSION=2.2
- php: 7.1
env: TARANTOOL_VERSION=2.3
- php: 7.1
env: TARANTOOL_VERSION=2.4
- php: 7.1
env: TARANTOOL_VERSION=2.5
# PHP 7.2
# -------
- php: 7.2
env: TARANTOOL_VERSION=1.9
- php: 7.2
env: TARANTOOL_VERSION=1.10
- php: 7.2
env: TARANTOOL_VERSION=2.1
# - php: 7.2
env: TARANTOOL_VERSION=2.2
- php: 7.2
env: TARANTOOL_VERSION=2.3
- php: 7.2
env: TARANTOOL_VERSION=2.4
- php: 7.2
env: TARANTOOL_VERSION=2.5
# PHP 7.3
# -------
- php: 7.3
env: TARANTOOL_VERSION=1.9
- php: 7.3
env: TARANTOOL_VERSION=1.10
- php: 7.3
env: TARANTOOL_VERSION=2.1
# - php: 7.3
env: TARANTOOL_VERSION=2.2
- php: 7.3
env: TARANTOOL_VERSION=2.3
- php: 7.3
env: TARANTOOL_VERSION=2.4
- php: 7.3
env: TARANTOOL_VERSION=2.5
# PHP 7.4
# -------
- php: 7.4
env: TARANTOOL_VERSION=1.9
- php: 7.4
env: TARANTOOL_VERSION=1.10
- php: 7.4
env: TARANTOOL_VERSION=2.1
# - php: 7.4
env: TARANTOOL_VERSION=2.2
- php: 7.4
env: TARANTOOL_VERSION=2.3
- php: 7.4
env: TARANTOOL_VERSION=2.4
- php: 7.4
env: TARANTOOL_VERSION=2.5
# RPM packages
# ------------
# Note: CentOS 6 & 7 do not provide PHP 7.*.
# Note: Fedora < 25 do not provide PHP 7.*.
- env: OS=el DIST=8
- env: OS=fedora DIST=25
- env: OS=fedora DIST=26
- env: OS=fedora DIST=27
- env: OS=fedora DIST=28
- env: OS=fedora DIST=29
- env: OS=fedora DIST=30
- env: OS=fedora DIST=31
# Deb packages
# ------------
# Debian < 8 (Stretch) do not provide PHP 7.*.
# Ubuntu < 16.04 (Xenial) do not provide PHP 7.*.
- env: OS=debian DIST=stretch
- env: OS=debian DIST=buster
- env: OS=ubuntu DIST=xenial
- env: OS=ubuntu DIST=bionic
- env: OS=ubuntu DIST=eoan
- env: OS=ubuntu DIST=focal
python:
- 2.7
script:
- |
# Make shell strictier.
#
# - Exit with a failure on a first failed command.
# - Print each executed commmand.
set -ex
if [ -n "${TARANTOOL_VERSION}" ]; then
./test.sh
elif [ -n "${OS}" ] && [ -n "${DIST}" ]; then
git clone --depth 1 https://github.com/packpack/packpack.git
./packpack/packpack
if [ "${OS}" = "el" ]; then
DOCKER_IMAGE="centos:${DIST}"
else
DOCKER_IMAGE="${OS}:${DIST}"
fi
docker run \
--volume "$(realpath .):/tarantool-php" \
--workdir /tarantool-php \
--rm \
"${DOCKER_IMAGE}" \
./test.pkg.sh
else
exit 1
fi
# Deploy
# ------
# Skip deployment when it is not expected.
if [ -z "${OS}" ] || [ -z "${DIST}" ]; then
echo "Skip deployment: it is pure testing job w/o any RPM / Deb artefacts"
exit 0
fi
if [ "${TRAVIS_REPO_SLUG}" != "tarantool/tarantool-php" ]; then
echo "Skip deployment: it is a fork, not the base repository"
exit 0
fi
if [ "${TRAVIS_EVENT_TYPE}" != "push" ]; then
echo "Skip deployment: event is not 'push', but ${TRAVIS_EVENT_TYPE}"
exit 0
fi
# Choose destination to push packages.
if [ "${TRAVIS_BRANCH}" == "master" ] || [ -n "${TRAVIS_TAG}" ]; then
echo "Set production deployment parameters"
configuration=production
else
echo "Set staging deployment parameters"
configuration=staging
fi
# Deploy to packagecloud repositories.
./.travis/deploy_packagecloud.sh ${configuration}
# Deploy to S3 based repositories.
./.travis/deploy_s3_dependencies.sh
./.travis/deploy_s3.sh ${configuration}