Skip to content

Commit

Permalink
Improve TravisCI file with steps
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <[email protected]>
  • Loading branch information
williamdes committed Oct 21, 2019
1 parent 5f2beb0 commit 9d1872d
Showing 1 changed file with 77 additions and 30 deletions.
107 changes: 77 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ services:
- docker

language: python
python:
- "2.7"
python: 2.7
dist: bionic

env:
matrix:
- DB=mysql:latest
- DB=mariadb:latest
stages:
- name: "Build images"
- name: "Test docker-compose"
- name: "Run tests in testing container"

before_install:
- export TESTSUITE_PASSWORD=`openssl rand -base64 30`
Expand All @@ -17,27 +17,74 @@ before_install:
install:
- pip install mechanize html5lib

script:
# Run tests in testing container
- docker-compose -f docker-compose.testing.yml up -d db_server
- docker-compose -f docker-compose.testing.yml up -d
- docker-compose exec phpmyadmin /test-docker.sh phpmyadmin_testing 80 phpmyadmin_testing_db
- docker-compose stop
# Test docker-compose
- docker-compose -f docker-compose.yml -f docker-compose.db.yml up -d
- ./testing/test-docker.sh phpmyadmin 8080 db_server
- docker-compose stop
# Build image
- docker build -t phpmyadmin/phpmyadmin apache
# Test for single database
- docker run --name testadmin -d --link db_server:db -p 9090:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh testadmin 9090
# Test for single database using env
- docker run --name envadmin -d --link db_server:db2 -e PMA_HOST=db2 -p 6060:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh envadmin 6060
# Test for arbitrary database
- docker run --name arbitraryadmin -d --link db_server:db3 -e PMA_ARBITRARY=1 -p 7070:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh arbitraryadmin 7070 db3
# Test for arbitrary database with user config
- docker run --name userconfigadmin -d --link db_server:db3 -v `readlink -f ./testing/config.test.inc.php`:/etc/phpmyadmin/config.user.inc.php -p 7080:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh userconfigadmin 7080 db3
_helpers:
- &test-docker-compose
stage: "Test docker-compose"
script:
- docker-compose -f docker-compose.testing.yml up -d db_server
- docker-compose -f docker-compose.testing.yml up -d
- docker-compose exec phpmyadmin /test-docker.sh phpmyadmin_testing 80 phpmyadmin_testing_db
- docker-compose stop
- &test-apache-image
stage: "Run tests in testing container"
script:
# Build image
- docker build -t phpmyadmin/phpmyadmin apache
# Test for single database
- docker run --name testadmin -d --link db_server:db -p 9090:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh testadmin 9090
# Test for single database using env
- docker run --name envadmin -d --link db_server:db2 -e PMA_HOST=db2 -p 6060:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh envadmin 6060
# Test for arbitrary database
- docker run --name arbitraryadmin -d --link db_server:db3 -e PMA_ARBITRARY=1 -p 7070:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh arbitraryadmin 7070 db3
# Test for arbitrary database with user config
- docker run --name userconfigadmin -d --link db_server:db3 -v `readlink -f ./testing/config.test.inc.php`:/etc/phpmyadmin/config.user.inc.php -p 7080:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh userconfigadmin 7080 db3
- &test-docker-compose-db
stage: "Test docker-compose"
script:
- docker-compose -f docker-compose.yml -f docker-compose.db.yml up -d
- ./testing/test-docker.sh phpmyadmin 8080 db_server
- docker-compose stop
- &build-image
stage: "Build images"
before_install: skip
install: skip

jobs:
include:
- <<: *test-docker-compose
name: "Run and stop container using testing docker-compose file for MariaDB"
env: DB=mariadb:latest
- <<: *test-docker-compose
name: "Run and stop container using testing docker-compose file for MySQL"
env: DB=mysql:latest
- <<: *test-docker-compose-db
name: "Run and stop container using db docker-compose file for MariaDB"
env: DB=mariadb:latest
- <<: *test-docker-compose-db
name: "Run and stop container using db docker-compose file for MySQL"
env: DB=mysql:latest
- <<: *build-image
name: "Apache amd64"
arch: amd64
script:
- docker build -t phpmyadmin/phpmyadmin apache
- <<: *build-image
name: "fpm amd64"
arch: amd64
script:
- docker build -t phpmyadmin/phpmyadmin fpm
- <<: *build-image
name: "fpm-alpine amd64"
arch: amd64
script:
- docker build -t phpmyadmin/phpmyadmin fpm-alpine
- <<: *test-apache-image
name: "Run testing for MariaDB"
env: DB=mariadb:latest
- <<: *test-apache-image
name: "Run testing for MySQL"
env: DB=mysql:latest

0 comments on commit 9d1872d

Please sign in to comment.