forked from million12/docker-nginx-php
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcircle.yml
More file actions
61 lines (51 loc) · 2.72 KB
/
circle.yml
File metadata and controls
61 lines (51 loc) · 2.72 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
machine:
services:
- docker
dependencies:
override:
- docker build -t million12/nginx-php .
# Do basic test in `dependencies` section - it doesn't make to continue if it fails here
- docker run -d --name nginx million12/nginx-php
- docker logs -f nginx > ${CIRCLE_ARTIFACTS}/docker-nginx.log:
background: true
- sleep 3
- docker logs nginx | grep "nginx entered RUNNING state"
- docker rm -f nginx || true
# Run tests
test:
override:
# Launch it
- docker run -d -p 8080:80 --name nginx --env="NGINX_GENERATE_DEFAULT_VHOST=true" million12/nginx-php
- while true; do if docker logs nginx | grep "nginx entered RUNNING state"; then break; else sleep 1; fi done
- curl -Ssi http://localhost:8080
- curl -Ssi http://localhost:8080 | grep '200 OK'
# Check phpinfo page (we have it because NGINX_GENERATE_DEFAULT_VHOST is set)
- curl -Ssi http://localhost:8080 | grep 'PHP Version 7'
# Check if custom php.ini directives are applied
- curl -Ssi http://localhost:8080 | grep memory_limit | grep 512M
# Check if we have PECL extensions installed / loaded
- curl -Ssi http://localhost:8080 | grep 'Redis Version'
# Check if PHP is available in PATH
- docker run -ti million12/nginx-php "php -v"
- docker run -ti million12/nginx-php "php -i"
# Check if we have common dev tools working
- docker run -ti million12/nginx-php "mysql --version"
- docker run -ti million12/nginx-php "git --version"
- docker run -ti million12/nginx-php "ruby -v"
- docker run -ti million12/nginx-php "gem -v"
- docker run -ti million12/nginx-php "nvm --version"
- docker run -ti million12/nginx-php "node -v"
- docker run -ti million12/nginx-php "npm -v"
- docker run -ti million12/nginx-php "grunt --version"
- docker run -ti million12/nginx-php "gulp -v"
- docker rm -f nginx || true
# Check if status page for PHP-FPM is working
- docker run -d -p 80:80 --name nginx --env="NGINX_GENERATE_DEFAULT_VHOST=true" million12/nginx-php
- while true; do if docker logs nginx | grep "nginx entered RUNNING state"; then break; else sleep 1; fi done
- curl -Ssi http://localhost/fpm_status | grep "HTTP/1.1 403 Forbidden"
- docker rm -f nginx || true
- docker run -d -p 80:80 --name nginx --env="NGINX_GENERATE_DEFAULT_VHOST=true" --env="STATUS_PAGE_ALLOWED_IP=$(ip -4 addr show docker0 | grep inet | cut -d/ -f1 | awk '{print $2}')" million12/nginx-php
- while true; do if docker logs nginx | grep "nginx entered RUNNING state"; then break; else sleep 1; fi done
- curl -Ssi http://localhost/fpm_status
- curl -Ssi http://localhost/fpm_status | grep "HTTP/1.1 200 OK"
- curl -Ssi http://localhost/fpm_status | grep "start time"