Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit be46cf3

Browse files
committed
Upgraded CI to Docker file format v3 (but still declaring it as v2, as Travis doesn't support v3).
1 parent ca89ee3 commit be46cf3

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

.travis.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ matrix:
3838
- DB_HOST=postgres
3939
- DB_USERNAME=postgres
4040

41-
cache:
42-
directories:
43-
- ./node_modules
44-
- ./vendor
45-
4641
before_install:
4742
- curl -L https://github.com/docker/compose/releases/download/1.8.1/docker-compose-`uname -s`-`uname -m` > docker-compose; chmod +x docker-compose; true
4843
- sudo mv docker-compose /usr/local/bin/
@@ -67,8 +62,8 @@ install:
6762
- docker-compose up -d php${PHP_VERSION}-cli;
6863
- docker images;
6964
- docker-compose ps;
70-
- echo $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' basis_nginxForPhp${PHP_VERSION}_1) basis.audith.org | sudo tee -a /etc/hosts;
71-
- docker exec basis_php${PHP_VERSION}-cli_1 /bin/bash -c "echo $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' basis_nginxForPhp${PHP_VERSION}_1) basis.audith.org | sudo tee -a /etc/hosts";
65+
- echo $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx) basis.audith.org | sudo tee -a /etc/hosts;
66+
- docker exec dev-env /bin/bash -c "echo $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx) basis.audith.org | sudo tee -a /etc/hosts";
7267

7368
before_script:
7469
- chmod +x ./storage/build/scripts/ci/build.sh;
@@ -77,7 +72,7 @@ script:
7772
- ./storage/build/scripts/ci/build.sh;
7873

7974
after_script:
80-
- docker exec basis_php${PHP_VERSION}-cli_1 /bin/bash -c "pkill sc";
75+
- docker exec dev-env /bin/bash -c "pkill sc";
8176
- if [[ $PHP_VERSION == 7 && $DB_CONNECTION == 'mysql' ]]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover ./storage/coverage/coverage-clover-merged.xml; fi
8277

8378
notifications:

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@ version: '2'
22

33
services:
44
mariadb:
5+
container_name: mariadb
56
image: mariadb:10.1
67
environment:
78
MYSQL_DATABASE: "basis"
89
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
910
postgres:
11+
container_name: postgres
1012
image: postgres:latest
1113
environment:
1214
POSTGRES_DB: "basis"
1315
POSTGRES_PASSWORD: ""
1416
redis:
17+
container_name: redis
1518
image: redis
1619
php5-fpm:
20+
container_name: php-fpm
1721
build:
1822
context: ./storage/build/scripts/php_5.6-fpm
1923
image: audithsoftworks/basis:php_5.6-fpm
@@ -28,6 +32,7 @@ services:
2832
XDEBUG_CONFIG: "remote_host=172.17.0.1"
2933
REDIS_PORT: 6379
3034
php7-fpm:
35+
container_name: php-fpm
3136
build:
3237
context: ./storage/build/scripts/php_7-fpm
3338
image: audithsoftworks/basis:php_7-fpm
@@ -42,6 +47,7 @@ services:
4247
XDEBUG_CONFIG: "remote_host=172.17.0.1"
4348
REDIS_PORT: 6379
4449
nginxForPhp5:
50+
container_name: nginx
4551
build:
4652
context: ./storage/build/scripts/nginx
4753
image: audithsoftworks/basis:nginx
@@ -52,6 +58,7 @@ services:
5258
links:
5359
- php5-fpm:phpFpm
5460
nginxForPhp7:
61+
container_name: nginx
5562
build:
5663
context: ./storage/build/scripts/nginx
5764
image: audithsoftworks/basis:nginx
@@ -62,6 +69,7 @@ services:
6269
links:
6370
- php7-fpm:phpFpm
6471
php5-cli:
72+
container_name: dev-env
6573
build:
6674
context: ./storage/build/scripts/php_5.6
6775
image: audithsoftworks/basis:php_5.6
@@ -81,6 +89,7 @@ services:
8189
stdin_open: true
8290
tty: true
8391
php7-cli:
92+
container_name: dev-env
8493
build:
8594
context: ./storage/build/scripts/php_7
8695
image: audithsoftworks/basis:php_7

storage/build/scripts/ci/build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ test -f .env || sed \
88
-e "s/SAUCE_ACCESS_KEY=.*/SAUCE_ACCESS_KEY=${SAUCE_ACCESS_KEY}/g" .env.example \
99
| tee .env > /dev/null 2>&1;
1010

11-
docker exec basis_php${PHP_VERSION}-cli_1 /bin/bash -c "
11+
docker exec dev-env /bin/bash -c "
1212
export NPM_CONFIG_LOGLEVEL=warn;
1313
export SAUCE_BUILD=audithsoftworks-basis-travis-job-${TRAVIS_JOB_NUMBER};
1414
export SAUCE_USERNAME=${SAUCE_USERNAME};
1515
export SAUCE_ACCESS_KEY=${SAUCE_ACCESS_KEY};
1616
17+
sudo chown -R basis:basis ./*;
18+
ls -l;
19+
1720
daemon -U --respawn -- phantomjs --webdriver=25852 --webdriver-logfile=\$WORKDIR/storage/logs/phantomjs.log --webdriver-loglevel=DEBUG;
1821
if [[ ${PHP_VERSION} == 7 && ${DB_CONNECTION} == 'mysql' ]]; then
1922
wget -P ./storage/build/tools https://saucelabs.com/downloads/sc-4.4.5-linux.tar.gz;

storage/build/scripts/dev-env/build.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
#docker build -f storage/build/scripts/php_7/Dockerfile -t audithsoftworks/basis:php_7 .;
77
#docker build -f storage/build/scripts/php_7-fpm/Dockerfile -t audithsoftworks/basis:php_7-fpm .;
88

9-
if [[ -z ${COMPOSE_PROJECT_NAME+x} ]]; then
10-
export COMPOSE_PROJECT_NAME=basis_;
11-
fi;
12-
139
docker-compose build
1410
#docker-compose pull;
1511

@@ -18,8 +14,8 @@ if [ -z ${PHP_VERSION+x} ]; then export PHP_VERSION='7'; fi; # 5|7
1814
docker-compose down;
1915
docker-compose up -d php${PHP_VERSION}-cli;
2016
docker-compose ps;
21-
docker exec ${COMPOSE_PROJECT_NAME}php${PHP_VERSION}-cli_1 \
22-
/bin/bash -c "echo $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PROJECT_NAME}nginxForPhp${PHP_VERSION}_1) basis.audith.org | sudo tee -a /etc/hosts";
17+
docker exec dev-env \
18+
/bin/bash -c "echo $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx) basis.audith.org | sudo tee -a /etc/hosts";
2319

2420
test -f .env || cat .env.example | tee .env > /dev/null 2>&1;
2521

@@ -28,7 +24,7 @@ test -f .env || cat .env.example | tee .env > /dev/null 2>&1;
2824
# and SAUCE_ACCESS_KEY env variables to the environment for which the next 'docker exec' is being run.
2925
###############################################################################################################
3026

31-
docker exec ${COMPOSE_PROJECT_NAME}php${PHP_VERSION}-cli_1 bash -c "
27+
docker exec dev-env bash -c "
3228
if [ ! -f ~/.bash_profile ]; then touch ~/.bash_profile; fi;
3329
if [ ! \$(cat ~/.bash_profile | grep SAUCE_) ]; then
3430
echo 'export SAUCE_USERNAME=\"$SAUCE_USERNAME\"' | sudo tee -a ~/.bash_profile;

0 commit comments

Comments
 (0)