devilbox/.travis.yml

91 lines
2.4 KiB
YAML
Raw Normal View History

2016-11-03 13:48:09 +00:00
language: python
python:
- 2.7
###
### Add services
###
services:
- docker
###
### Global variables
###
env:
global:
2016-11-15 19:42:41 +00:00
- DEVILBOX_PHP_VERSION="$( grep -Eo 'image:.*PHP.*:.*' docker-compose.yml | sed 's/.*:.*://g' )"
- DEVILBOX_HTTPD_VERSION="$( grep -Eo 'image:.*HTTPD.*:.*' docker-compose.yml | sed 's/.*:.*://g' )"
- DEVILBOX_MYSQL_VERSION="$( grep -Eo 'image:.*MYSQL.*:.*' docker-compose.yml | sed 's/.*:.*://g' )"
2016-11-03 13:48:09 +00:00
2016-11-03 15:06:54 +00:00
###
### Berfore Install
###
before_install:
# List versions
- docker version
- docker-compose version
2016-11-03 13:48:09 +00:00
###
2016-11-15 19:45:57 +00:00
### Install
2016-11-03 13:48:09 +00:00
###
2016-11-15 19:45:57 +00:00
install:
2016-11-03 13:48:09 +00:00
# php
2016-11-15 20:02:03 +00:00
#- docker pull cytopia/php-fpm-5.4:${DEVILBOX_PHP_VERSION}
#- docker pull cytopia/php-fpm-5.5:${DEVILBOX_PHP_VERSION}
#- docker pull cytopia/php-fpm-5.6:${DEVILBOX_PHP_VERSION}
#- docker pull cytopia/php-fpm-7.0:${DEVILBOX_PHP_VERSION}
#- docker pull cytopia/php-fpm-7.1:${DEVILBOX_PHP_VERSION}
## web
#- docker pull cytopia/apache-2.2:${DEVILBOX_HTTPD_VERSION}
#- docker pull cytopia/apache-2.4:${DEVILBOX_HTTPD_VERSION}
#- docker pull cytopia/nginx-stable:${DEVILBOX_HTTPD_VERSION}
#- docker pull cytopia/nginx-mainline:${DEVILBOX_HTTPD_VERSION}
## mysql/mariadb
#- docker pull cytopia/mysql-5.5:${DEVILBOX_MYSQL_VERSION}
#- docker pull cytopia/mysql-5.6:${DEVILBOX_MYSQL_VERSION}
#- docker pull cytopia/mysql-5.7:${DEVILBOX_MYSQL_VERSION}
#- docker pull cytopia/mariadb-5.5:${DEVILBOX_MYSQL_VERSION}
#- docker pull cytopia/mariadb-10.0:${DEVILBOX_MYSQL_VERSION}
#- docker pull cytopia/mariadb-10.1:${DEVILBOX_MYSQL_VERSION}
#- docker pull cytopia/mariadb-10.2:${DEVILBOX_MYSQL_VERSION}
## postgresql (official images)
#- docker pull postgres:9.2
#- docker pull postgres:9.3
#- docker pull postgres:9.4
#- docker pull postgres:9.5
2016-11-15 20:42:51 +00:00
#- docker pull postgres:9.6
2016-11-15 19:26:53 +00:00
2016-11-15 19:45:57 +00:00
###
### Test
###
script:
2016-11-15 19:26:53 +00:00
- cp env-example .env
2016-11-15 20:01:06 +00:00
# PostgreSQL port seems already been taken
2016-11-15 20:14:47 +00:00
- sed -i'' 's/127.0.0.1:5432/127.0.0.1:54320/g' docker-compose.yml
- sed -i'' 's/127.0.0.1:3306/127.0.0.1:33060/g' docker-compose.yml
2016-11-15 20:01:06 +00:00
2016-11-15 20:42:51 +00:00
- mkdir -p ~/data/mysql57
- mkdir -p ~/data/postgres96
- mkdir -p ~/Sites
- chmod 777 ~/data/mysql57
- chmod 777 ~/data/postgres96
- chmod 777 ~/Sites
2016-11-15 20:01:06 +00:00
# Start
2016-11-15 19:42:41 +00:00
- docker-compose up -d
2016-11-15 19:26:53 +00:00
- sleep 30
2016-11-15 20:15:52 +00:00
# Show info
- docker-compose logs
2016-11-15 19:26:53 +00:00
- docker-compose ps
2016-11-15 20:15:52 +00:00
# Check running containers
2016-11-15 19:45:57 +00:00
- if [ "$( docker-compose ps | grep -c 'Up' )" != "4" ]; then false; fi
2016-11-15 20:15:52 +00:00
# Crawl page
2016-11-15 19:26:53 +00:00
- wget http://localhost