-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
52 lines (41 loc) · 961 Bytes
/
.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
language: php
sudo: required
dist: xenial
php:
- 7.3
branches:
only:
- master
services:
- docker
- mysql
before_install:
- mysql -e 'create database testing;'
cache:
directories:
- node_modules
- vendor
before_script:
- cp .docker/php/.env.travis backend/.env.testing
- cd backend
- composer self-update
- composer install --no-interaction
- cp .env.example .env
- .env | sort
- IMAGE_NAME=p2sousa/codeflix-service-video
- IMAGE_LATEST_VERSION="${IMAGE_NAME}:latest"
script:
- vendor/bin/phpunit --coverage-clover=coverage.xml
- cd ..
- docker build -t "${IMAGE_LATEST_VERSION}" -f Dockerfile.prod .
after_success:
- bash <(curl -s https://codecov.io/bash)
after_script:
- docker images
before_deploy:
- echo "${DOCKER_HUB_PASSWORD}" | docker login --username "${DOCKER_HUB_USER}" --password-stdin
deploy:
provider: script
script: docker push "${IMAGE_LATEST_VERSION}"
on:
branch: master