-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
41 lines (37 loc) · 1.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
sudo: required
language: php
services:
- docker
jobs:
include:
- stage: test
if: type = pull_request
before_install:
- docker build -t jianzhong/php7_fpm_symfony4_git -f docker/fpm.dev.Dockerfile docker/.
- docker-compose -f docker/docker-compose.yml up -d
install:
- docker container exec cicd-php-1 symfony composer install
script:
- docker container exec cicd-php-1 bin/phpunit
after_script:
- docker-compose down -f docker/docker-compose.yml
- docker system prune -a -f --volumes
- stage: "deploy test"
if: branch = master AND type = push
before_install:
- docker build -t jianzhong/s4-cicd-fpm-prod -f docker/fpm.prod.Dockerfile .
- docker build -t jianzhong/s4-cicd-nginx-prod -f docker/nginx.prod.Dockerfile docker
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker push jianzhong/s4-cicd-fpm-prod
- docker push jianzhong/s4-cicd-nginx-prod
install: skip
#- scp docker/stack-composer files to swarm master node in production server cluster
#- ssh into swarm master node in production server cluster
#- docker pull jianzhong/s4-cicd-fpm-prod:latest
#- docker pull jianzhong/s4-cicd-nginx-prod:latest
script: skip
deploy:
- provider: script
script:
- docker system prune -a -f --volumes
#- docker stack deploy -c stack-compose.yaml