Skip to content

Commit cd4f1f9

Browse files
authored
Merge pull request #81 from mattrayner/mattrayner/rebase-refactor
[WIP] Add MySQL test
2 parents 4d154aa + 05bcf42 commit cd4f1f9

File tree

7 files changed

+26
-9
lines changed

7 files changed

+26
-9
lines changed

.circleci/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ jobs:
44
machine: true
55
steps:
66
- checkout
7-
- run: make test
7+
- run: |
8+
sudo apt-get update
9+
sudo apt-get install -y mysql-client
10+
make test
811
912
deploy:
1013
machine: true

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ run-tests:
1515
cd tests && ./test.sh
1616

1717
clean:
18-
docker-compose -f docker-compose.test.yml down
18+
docker-compose -f docker-compose.test.yml down

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ Designed to be a single interface that just 'gets out of your way', and works on
5353
5454
> **NOTE**: The 14.04 variant of this image is no longer being actively supported for updated
5555
56-
There are 4 main 'versions' of the docker image. The table below shows the different tags you can use, along with the PHP, MySQL and Apache versions that come with it.
56+
There are 3 main 'versions' of the docker image. The table below shows the different tags you can use, along with the PHP, MySQL and Apache versions that come with it.
5757

5858
Component | `latest-1404` | `latest-1604` | `latest-1804`
5959
---|---|---|---
6060
[Apache][apache] | `2.4.7` | `2.4.18` | `2.4.29`
61-
[MySQL][mysql] | `5.5.62` | `5.7.26` | `5.7.26`
62-
[PHP][php] | `7.3.3` | `7.3.6` | `7.3.6`
63-
[phpMyAdmin][phpmyadmin] | `4.8.5` | `4.9.0.1` | `4.9.0.1`
61+
[MySQL][mysql] | `5.5.62` | `5.7.29` | `5.7.29`
62+
[PHP][php] | `7.3.3` | `7.4.3` | `7.4.3`
63+
[phpMyAdmin][phpmyadmin] | `4.8.5` | `5.0.1` | `5.0.1`
6464

6565

6666
## Using the image

docker-compose.test.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
web1804-php7:
22
build: .
33
dockerfile: ./1804/Dockerfile
4+
environment:
5+
- MYSQL_ADMIN_PASS=password
46
ports:
57
- "3000:80"
8+
- "3001:3306"
69

710
web1604-php7:
811
build: .
912
dockerfile: ./1604/Dockerfile
13+
environment:
14+
- MYSQL_ADMIN_PASS=password
1015
ports:
11-
- "3001:80"
16+
- "3010:80"
17+
- "3011:3306"

tests/1604.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
22
source _helpers.sh
33

4-
testimage 1604-php7 3001
4+
testimage 1604-php7 3010
5+
testmysql web1604-php7 3011

tests/1804.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
22
source _helpers.sh
33

4-
testimage 1804-php7 3000
4+
testimage 1804-php7 3000
5+
testmysql web1804-php7 3001

tests/_helpers.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,10 @@ function testimage {
1919
diff -b actual/$1.html expected/$1.html
2020
checkstatus $?
2121
echo
22+
}
23+
24+
function testmysql {
25+
echo "=> Connecting to MySQL: ($1:$2)"
26+
mysql -h 127.0.0.1 -P $2 -u admin -ppassword -e"quit"
27+
checkstatus $?
2228
}

0 commit comments

Comments
 (0)