forked from emqxarchive/emqx-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (45 loc) · 1.3 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
sudo: 'required'
services:
- 'docker'
language:
- 'bash'
env:
matrix:
- BUILD_FROM=amd64/erlang:21-alpine QEMU_ARCH=x86_64 ARCH=amd64
- BUILD_FROM=emqx/erlang:21.2-arm32v6-alpine QEMU_ARCH=arm ARCH=arm32v6
- BUILD_FROM=arm64v8/erlang:21-alpine QEMU_ARCH=aarch64 ARCH=arm64v8
before_install:
- ./docker.sh prepare
install: true
script:
# Build Docker image
- ./docker.sh build
# Test Docker image
- ./docker.sh test
# Push Docker image
- >
if [[ ! -z $(echo $EMQX_VERSION | grep -oE "v[0-9]+\.[0-9]+(\.[0-9]+)?") ]]; then
# Tag Docker image
./docker.sh tag
# Docker Login
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
# Push Docker image
./docker.sh push
# Docker Logout
docker logout
fi
jobs:
include:
- stage: manifest
if: tag =~ ^v
script:
# Docker Login
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Create and Push Docker Manifest Lists to Docker Hub
- echo "Create manifest list for all docker images."
- ./docker.sh manifest-list
# Docker Logout
- docker logout
# notify me when things fail
notifications:
email: true