forked from felipemacahdo/open-loyalty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
37 lines (32 loc) · 2.72 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
sudo: required
env:
global:
- DOCKER_COMPOSE_VERSION: 1.9.0
- secure: "F821RSMdn/1kstmC0eNPgYMIpCUm3UluN6vj0LfptmBA2oYC1+dj4OaHqWW1X0RprT4vUBmY482+0fsELmY2AKEakryk8aAEQ/kHulDr6wu4k6fsepbzJmkj/35PltECu8FcCsNillMvWWAXqfdI63uqLZPupixS7HfXBzloZ9aQjqt+gtCfdZWZWM/pWvJuLS+ZQvhxtdrlrnetxxZcEfimQC2slsQaiuDLSo0qq96gzxXaFulrxjkV/KKCpU7M7USsvz8a26vHKiuHVkNy7EgU3hhYfljFEDrmkZEoPqwB8XrPd1FNJVTkW7UJhbz0ykazpPtoI4/FpBTGVDmaWqso1gmPS1jxQXrRUusa96zuoh5wCla4YlimijsGOzsc+HJpuA9bA6TDYM4PgX0fF3zanPlkspqjKRGq7if2oxBg442dTK+OlqTAe7yldFTNug/lqnUxGK1gKVTumN1ZyKzLgAqjDBjZqX6tcn59rkYFb0Q2lE7LX+OIc89DJy/TUzJalS3RXhpw6kD+uzCfYAXytaU24LHbgAZvF5VYrWLHLjOw1M5+lpwaMl/iH5al8Rcp3ypOvZq2FBFKP4H4fBY5IN7eOJvuzrx2OODMTmD4LzbNJ8WpQLb3qmxgf/WnXNo/lCaEt3Seok8ZdWk8b7REsm6YN+JkDtoXGFIqmkw="
- secure: "sV2ppBPTcWnl91pbV8Q0Fa7dnd+8mNWeuaWiqATpDCyCZTdKRFIqF9/GMJyCTp+d5m+mpMLXycAEQk4JpXY9XNG8zVqDzeQkutue7nrTr1eFr1yuHoPwdHUR4SM85F98T30Vl5gDfq5qOR+piHkQ0yxXI9vAhM6ZDgXTxWnYX2pPBIVo6to/nYThNeCGAJjEI1VJPxYkRTnGZHj9LIJB1aCCBA50o3zRv86IJkwX1VtFHVlsbqu2YpfXLKqAnzPsjCF0kXnUSAIkESRIDwtRzgFS2VQo/PIbwD8iNfHVJZ5MtEqC0ph/SVnSjCTHF/eAPv49tH1puhRTwAkgBkx2osBe7vY61HEK4GvyHtEODS6nSZycrlwzRde7gG0uIxaF1kuZj5LqNTd1DLWFSVTbYqoBfW76tveINaPgv3GGh5QphKFyBlLmzh7KDrAW69A5yGfLuO7gCf4NXWGDAzoSYNq9OoQugFh+b3KcEJCztMeMSDcfvIVixevAseBiWa/Bs5mPAcFK9OkbctKhygdjEpE+2EFh2HWl7uGJbonF66SX606+s+ulDl8BGWLpgKxuylqNZWb85gP3HcYNR+GtUq3kt9oL83nfogTgAD5+EYID9LhoORPOWW/1hIzb6xTTPsJkx/IQLMHsxBep31RhI1mzteLtxOI9priOSHjqSH8="
services:
- docker
before_install:
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
script:
- cd docker && docker-compose -f docker-compose.test.yml run php && cd ..
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin ;
docker build -t divante/open-loyalty-web:latest -f ./docker/prod/web/app-dockerfile .;
docker build -t divante/open-loyalty-fpm:latest -f ./docker/prod/php/fpm-dockerfile .;
docker push divante/open-loyalty-web:latest;
docker push divante/open-loyalty-fpm:latest;
fi
- if [ -n "$TRAVIS_TAG" ]; then
echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin ;
docker build -t divante/open-loyalty-web:$TRAVIS_TAG -f ./docker/prod/web/app-dockerfile .;
docker build -t divante/open-loyalty-fpm:$TRAVIS_TAG -f ./docker/prod/php/fpm-dockerfile .;
docker push divante/open-loyalty-web:$TRAVIS_TAG;
docker push divante/open-loyalty-fpm:$TRAVIS_TAG;
fi