-
Notifications
You must be signed in to change notification settings - Fork 8
/
circle.yml
92 lines (86 loc) · 3.45 KB
/
circle.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
machine:
services:
- docker
hosts:
neos: 127.0.0.1
dev.neos: 127.0.0.1
dependencies:
pre:
- docker info && docker version
override:
- docker pull million12/mariadb
- docker pull million12/neos-protobrew-distribution
- docker pull million12/php-testing:
background: true
post:
# Launch DB backend
- docker run -d --name=db --env="MARIADB_PASS=my-pass" million12/mariadb
- docker logs -f db | tee -a ${CIRCLE_ARTIFACTS}/docker-db.log:
background: true
# Run tests
test:
override:
# ######################################################
# Run Neos CMS container, which includes
# M12.Foundation / M12.FoundationSite packages
# and do some basics checks.
# ######################################################
- |
docker run -d \
--name=neos -p=8080:80 \
--link=db:db \
--env="T3APP_NAME=neos" \
--env="T3APP_VHOST_NAMES=neos dev.neos behat.dev.neos" \
--env="T3APP_ALWAYS_DO_PULL=true" \
million12/neos-protobrew-distribution " \
su www -c \"
cd ~/neos; \
composer update m12/*; \
cd Packages/Plugins/M12.Foundation; \
git fetch origin && git checkout --force -b $CIRCLE_BRANCH origin/$CIRCLE_BRANCH; \
cd ~/neos; \
./flow flow:cache:flush --force; \
./flow cache:warmup
\"
"
- docker logs -f neos > ${CIRCLE_ARTIFACTS}/docker-neos.log 2>&1:
background: true
# Wait till TYPO3 Neos is fully configured
- while true; do if grep "nginx entered RUNNING state" ${CIRCLE_ARTIFACTS}/docker-neos.log; then break; else sleep 1; fi done
# Test: do basic front-end tests
- curl -L --head http://neos:8080 && curl -s -L http://neos:8080
- curl -s --head http://neos:8080 | grep "HTTP/1.1 200 OK" && curl -s --head http://neos:8080 | grep "X-Flow-Powered"
- curl -s -L http://neos:8080/neos | grep "Login to"
# Run unit tests:
- |
docker run -ti --volumes-from=neos --link=neos:web --link=db:db million12/php-testing "
env && \
echo \$WEB_PORT_80_TCP_ADDR \$WEB_ENV_T3APP_VHOST_NAMES >> /etc/hosts && cat /etc/hosts && \
su www -c \"
cd ~/neos && \
echo -e '\n\n======== RUNNING UNIT TESTS =======\n\n' && \
bin/phpunit -c Build/BuildEssentials/PhpUnit/UnitTests.xml --colors
\"
"
# Run ALL functional tests (but regardless of results do NOT fail, because some vendor tests might fail)
- |
docker run -ti --volumes-from=neos --link=neos:web --link=db:db million12/php-testing "
env && \
echo \$WEB_PORT_80_TCP_ADDR \$WEB_ENV_T3APP_VHOST_NAMES >> /etc/hosts && cat /etc/hosts && \
su www -c \"
cd ~/neos && \
echo -e '\n\n======== RUNNING FUNCTIONAL TESTS =======\n\n' && \
bin/phpunit -c Build/BuildEssentials/PhpUnit/FunctionalTests.xml --colors
\"
" || true
# Run M12 functional tests only (and fail on error)
- |
docker run -ti --volumes-from=neos --link=neos:web --link=db:db million12/php-testing "
env && \
echo \$WEB_PORT_80_TCP_ADDR \$WEB_ENV_T3APP_VHOST_NAMES >> /etc/hosts && cat /etc/hosts && \
su www -c \"
cd ~/neos && \
echo -e '\n\n======== RUNNING FUNCTIONAL TESTS =======\n\n' && \
bin/phpunit -c Build/BuildEssentials/PhpUnit/FunctionalTests.xml --colors --filter M12
\"
"