-
Notifications
You must be signed in to change notification settings - Fork 183
/
.travis.yml
90 lines (65 loc) · 4.49 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
os: linux
dist: focal
language: php
php:
- 7.4
branches:
only:
- develop
- /^v?(\d+\.)?(\d+\.)?(\d+)(-[a-z\d]+)?$/
- freddy
# - master
git:
# Tell Travis not to try to load submodules
# We'll do that further down
submodules: false
before_install:
- export BUILD=$(awk 'NF>1 {print $3}' inc/version.ini | sed 's/"//g')
- pip install -U pip
- pip install awscli
# Change ssh to https in the submodule file because travis make calls on https with its own token
- sed -i "s/[email protected]:/https:\/\/${CI_USER_TOKEN_MATECATBOT}@github.com\//" .gitmodules
# Update plugins files submodule
- git submodule update --init --recursive
script:
- |
echo "Load services"
docker-compose -f docker/docker-compose-ci.yml build mysql redis > /dev/null 2>&1
docker-compose -f docker/docker-compose-ci.yml create mysql redis > /dev/null 2>&1
# keep logs for the base node
docker-compose -f docker/docker-compose-ci.yml build base-node
# silent for test node
echo "Build test node"
docker-compose -f docker/docker-compose-ci.yml build test-node > /dev/null 2>&1
# Run tests
docker-compose -f docker/docker-compose-ci.yml up test-node --exit-code-from test-node || exit 1
if [[ ! -z "${TRAVIS_TAG}" ]] ; then
docker-compose -f docker/docker-compose-ci.yml build || exit 1
docker tag matecat/matecat-web-node 449641877310.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-web-node:latest
docker tag matecat/matecat-web-node 449641877310.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-web-node:build-${BUILD}-${TRAVIS_BUILD_NUMBER}
docker tag matecat/matecat-daemons-node 449641877310.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-daemons-node:latest
docker tag matecat/matecat-daemons-node 449641877310.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-daemons-node:build-${BUILD}-${TRAVIS_BUILD_NUMBER}
# AWS CLI V1
$( aws ecr get-login --no-include-email --region eu-central-1 )
docker push 449641877310.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-web-node:build-${BUILD}-${TRAVIS_BUILD_NUMBER}
docker push 449641877310.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-daemons-node:build-${BUILD}-${TRAVIS_BUILD_NUMBER}
docker push 449641877310.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-web-node:latest
docker push 449641877310.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-daemons-node:latest
elif [[ "${TRAVIS_BRANCH}" == "freddy" ]] ; then
export AWS_ACCESS_KEY_ID=${BETA_AWS_ACCESS_KEY_ID}
export AWS_SECRET_ACCESS_KEY=${BETA_AWS_SECRET_ACCESS_KEY}
docker-compose -f docker/docker-compose-ci.yml build || exit 1
docker tag matecat/matecat-web-node 208060995276.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-web-node:latest
docker tag matecat/matecat-web-node 208060995276.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-web-node:build-${BUILD}-${TRAVIS_BUILD_NUMBER}
docker tag matecat/matecat-daemons-node 208060995276.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-daemons-node:latest
docker tag matecat/matecat-daemons-node 208060995276.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-daemons-node:build-${BUILD}-${TRAVIS_BUILD_NUMBER}
# AWS CLI V1
$( aws ecr get-login --no-include-email --region eu-central-1 )
docker push 208060995276.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-web-node:build-${BUILD}-${TRAVIS_BUILD_NUMBER}
docker push 208060995276.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-daemons-node:build-${BUILD}-${TRAVIS_BUILD_NUMBER}
docker push 208060995276.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-web-node:latest
docker push 208060995276.dkr.ecr.eu-central-1.amazonaws.com/matecat/matecat-daemons-node:latest
fi
notifications:
slack:
secure: duxxqPQPThoGXUGoZWoRymKlAhIJTL/APgZfQ1m4uroSLW3wlbmCJjXXEfeNE9wC8OQ+9XtSGVSdJYugGcoOFT2Xjh1UmiV8Rd+/avEbo6Wj465QcxlypcJF09XN5oaxkf+Gokn0P9zBmVS5EwNART45acR2YU3qHqvd4V5vOtflj1CXewYQlX9J7+nDtMR9tR/AA6RN3WFBGVUI68udpkGtntJ1uH/1ZVGX2k29kDLeS2Nkc6SchUfescGVAnje3gJaxnKbD3oGd2VP3FAK0bwPA/C7AzB26OqbL9pXdzhrxe2QcxsI61TCLJ1gBLDuuioSCHwjJHXWK5v1sKSQxVCKkE2jPL4igUkRRz0qRO5XDqTXP2airsMDYhly559c71RR8Y14Pv4hLt1JcOcQ2w206OD1Ug8I7B5PrUDm2lSZi43gArT/OaL109dGf7dO2jiM7GBvnDiQUbE8G1f1194D8vYQqT03K6+ca5PGdSQnIVlcSQfgFkm6Y+Rubm3b2Km+EjJ83f+VMQ39pXR8zaF8FSAPHG7vQSKGTPTJlYYcfuOkd/vFG+vxLKuVygfAN/J7hjjrG9glJ5Vk/glGW4Z6cbHwq3BRSsoiNJxMNOfgx67r9gD6/nxSaO3BGvl5pU/PaQcvaW5XgzaI+JWuDppbRgpScLIp5cNN77b+LdA=